Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trouble running cucumber-js under windows #60

Closed
mobygeek opened this issue Apr 28, 2012 · 21 comments
Closed

trouble running cucumber-js under windows #60

mobygeek opened this issue Apr 28, 2012 · 21 comments

Comments

@mobygeek
Copy link

have followed the guidance, installed nodejs via msi. file

after that npm install would work only under c:\programfiles \nodejs. and everytime copied my whole workshop folder structure under node.js.

i tried both local and global npm run. after restrating machine i was able to run npm install to run under my workshop as workshopfolder\npm install --dev

it went smooth with instaling

however when i type @node_env=test .. as in guidance. it keep saying that it s not recognized command

however when i type cucumber.js it gives me script error pop up.
saying :

Script:

c.:\ users.currentuser\appdata\roaming\npm\cucumber.js

line:1
char:1
error:invalid character
code:800a03f6
source: miscrosoft jscript compilation error

when i open c.:\ users.currentuser\appdata\roaming\npm\cucumber.js i am having this

!/bin/sh

if [ -x "dirname "$0"/node" ]; then
"dirname "$0"/node" "dirname "$0"/../cucumber/bin/cucumber.js" "$@"
ret=$?
else
node "dirname "$0"/../cucumber/bin/cucumber.js" "$@"
ret=$?
fi
exit $ret


thanks for prompt response #jbpros

@jbpros
Copy link
Member

jbpros commented Apr 30, 2012

Thank you for reporting this. I've tried running Cucumber.js on Windows and I get the same errors as you do. I'll fix it.

@jbpros jbpros closed this as completed in 32b5ced May 2, 2012
@Jon-Biz
Copy link

Jon-Biz commented Sep 9, 2012

I just received this error message:

Script:

c.:\ users.currentuser\appdata\roaming\npm\cucumber.js

line:1
char:1
error:invalid character
code:800a03f6
source: miscrosoft jscript compilation error

on a new install of node 0.8.8 and a new npm install of cucumber. Thanks.

@jbpros
Copy link
Member

jbpros commented Sep 9, 2012

@Jon-Biz Try running cucumber-js instead of cucumber.js. Please open another issue if this doesn't solve your problem.

@ghost
Copy link

ghost commented Sep 20, 2015

@jbpros works fine, thanks! :-)

denford referenced this issue in denford/TuteCumber Jun 23, 2016
@BillWTian
Copy link

Hi @jbpros, I use cucumber-js instead of cucumber.js, but the other error still exist, do you know how to solve it?
C:\Users\hui\AppData\Roaming\npm>cucumber-js
SyntaxError: Unexpected token case
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:387:25)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)
at ProfileLoader. (C:\Users\hui\AppData\Roaming\npm\node_modules
cucumber\lib\cli\profile_loader.js:55:27)
at next (native)
at tryCatcher (C:\Users\hui\AppData\Roaming\npm\node_modules\cucumber\node_m
odules\bluebird\js\release\util.js:16:23)
at PromiseSpawn._promiseFulfilled (C:\Users\hui\AppData\Roaming\npm\node_mod
ules\cucumber\node_modules\bluebird\js\release\generators.js:97:49)
at Promise._settlePromise (C:\Users\hui\AppData\Roaming\npm\node_modules\cuc
umber\node_modules\bluebird\js\release\promise.js:574:26)
at Promise._settlePromise0 (C:\Users\hui\AppData\Roaming\npm\node_modules\cu
cumber\node_modules\bluebird\js\release\promise.js:614:10)
at Promise._settlePromises (C:\Users\hui\AppData\Roaming\npm\node_modules\cu
cumber\node_modules\bluebird\js\release\promise.js:693:18)
at Async._drainQueue (C:\Users\hui\AppData\Roaming\npm\node_modules\cucumber
\node_modules\bluebird\js\release\async.js:133:16)
at Async._drainQueues (C:\Users\hui\AppData\Roaming\npm\node_modules\cucumbe
r\node_modules\bluebird\js\release\async.js:143:10)

@vvedachalam
Copy link

I get the same error. Any updates on this?

@vvedachalam
Copy link

Error:
You appear to be executing an install of cucumber (most likely a global install)
that is different from your local install (the one required in your support files).
For cucumber to work, you need to execute the same install that is required in your support files.
Please execute the locally installed version to run your tests.

  Executed Path: C:\Users\Kanmani\AppData\Roaming\npm\node_modules\cucumber\lib\index.js
  Local Path:    C:\webdriverio-test\node_modules\cucumber\lib\index.js

at C:\Users\Kanmani\AppData\Roaming\npm\node_modules\cucumber\lib\cli\install_validator.js:20:13
at Generator.next (<anonymous>)
at Generator.tryCatcher (C:\Users\Kanmani\AppData\Roaming\npm\node_modules\cucumber\node_modules\bluebird\js\release\util.js:16:23)
at PromiseSpawn._promiseFulfilled (C:\Users\Kanmani\AppData\Roaming\npm\node_modules\cucumber\node_modules\bluebird\js\release\generators.js:97:49)
at Promise._settlePromise (C:\Users\Kanmani\AppData\Roaming\npm\node_modules\cucumber\node_modules\bluebird\js\release\promise.js:574:26)
at Promise._settlePromise0 (C:\Users\Kanmani\AppData\Roaming\npm\node_modules\cucumber\node_modules\bluebird\js\release\promise.js:614:10)
at Promise._settlePromises (C:\Users\Kanmani\AppData\Roaming\npm\node_modules\cucumber\node_modules\bluebird\js\release\promise.js:693:18)
at Async._drainQueue (C:\Users\Kanmani\AppData\Roaming\npm\node_modules\cucumber\node_modules\bluebird\js\release\async.js:133:16)
at Async._drainQueues (C:\Users\Kanmani\AppData\Roaming\npm\node_modules\cucumber\node_modules\bluebird\js\release\async.js:143:10)
at Immediate.Async.drainQueues (C:\Users\Kanmani\AppData\Roaming\npm\node_modules\cucumber\node_modules\bluebird\js\release\async.js:17:14)
at runCallback (timers.js:800:20)
at tryOnImmediate (timers.js:762:5)
at processImmediate [as _immediateCallback] (timers.js:733:5)

@charlierudolph
Copy link
Member

Do you have a question about that error? It tells you what needs to be done.

@vvedachalam
Copy link

@charlierudolph Sorry I passed wrong one.. Thanks for pointing.
I tried to change the executable path to local but getting :
Error:
You appear to be executing an install of cucumber (most likely a global install)
that is different from your local install (the one required in your support files).
For cucumber to work, you need to execute the same install that is required in your support files.
Please execute the locally installed version to run your tests.

  Executed Path: c:\webdriverio-test\node_modules\cucumber\lib\index.js
  Local Path:    C:\webdriverio-test\node_modules\cucumber\lib\index.js

at c:\webdriverio-test\node_modules\cucumber\lib\cli\install_validator.js:20:13
at Generator.next (<anonymous>)
at Generator.tryCatcher (c:\webdriverio-test\node_modules\bluebird\js\release\util.js:16:23)
at PromiseSpawn._promiseFulfilled (c:\webdriverio-test\node_modules\bluebird\js\release\generators.js:97:49)
at Promise._settlePromise (c:\webdriverio-test\node_modules\bluebird\js\release\promise.js:574:26)
at Promise._settlePromise0 (c:\webdriverio-test\node_modules\bluebird\js\release\promise.js:614:10)
at Promise._settlePromises (c:\webdriverio-test\node_modules\bluebird\js\release\promise.js:693:18)
at Async._drainQueue (c:\webdriverio-test\node_modules\bluebird\js\release\async.js:133:16)
at Async._drainQueues (c:\webdriverio-test\node_modules\bluebird\js\release\async.js:143:10)
at Immediate.Async.drainQueues (c:\webdriverio-test\node_modules\bluebird\js\release\async.js:17:14)
at runCallback (timers.js:800:20)
at tryOnImmediate (timers.js:762:5)
at processImmediate [as _immediateCallback] (timers.js:733:5)

@vvedachalam
Copy link

@charlierudolph Executed path I made c:/
When I changed to C:/ (Uppercase).... It started running
Cheers

@ShailendraPrSingh
Copy link

I got the same issue when I run command "cucumber.js". to fix it i just ran ">cucumber" and it worked perfectly well.

@jbpros
Copy link
Member

jbpros commented Jan 14, 2018

@ShailendraPrSingh See the note to Windows users on https://github.com/cucumber/cucumber-js/blob/master/docs/cli.md#cli

@narayanasamyramaiah
Copy link

@vvedachalam I AM ALSO FACING SAME iSSUE.hOW DID YOU CHANGE THE PATH?
wHERE SHOULD I CHANGE PLS TELL ME

@ghost
Copy link

ghost commented Apr 5, 2018

Can Someone please tell me how can I change the executable path to local path??

@charlierudolph
Copy link
Member

If you installed cucumber globally, uninstall it. Then from your project path, run ./node_modules/.bin/cucumber-js. If you add ./node_modules/.bin/ to your path, then you should be able to execute it via cucumber-js

@bhatikuldeep
Copy link

@charlierudolph I had the same error but on mac, followed your steps and works for me, thanks :)

@roshan-ship-it
Copy link

Hi @jbpros
I am windows user..
trying to run node_modules\cucumber\bin\cucumber-js

  1. it throws error not recognized.
  2. i think you fixed in this pr 32b5ced but i dont see those changes in package.json of cucumber @4.2.1
  3. Could you please tell me steps for windows

@manikandanks2000
Copy link

Hi
i see this issue after updatign the path variable in the environment mapped to the local cucumber framework.

can u help with the same

@Mani2424
Copy link

@charlierudolph Executed path I made c:/
When I changed to C:/ (Uppercase).... It started running
Cheers


@charlierudolph Executed path I made c:/
When I changed to C:/ (Uppercase).... It started running
Cheers

Could you please tell how did you changed c into capital C ?
Thanks

@davidhope
Copy link

davidhope commented Dec 10, 2018

FWIW I was running this in the git bash and the script was running under c:\users... and was getting the error mentioned above, I switched over to a windows command prompt and ran the same npm test command and it ran ok. Under cmd, the path it was running was c:\Users...

@lock
Copy link

lock bot commented Dec 10, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests