Cucumber-js: trouble running cucumber-js under windows

Created on 28 Apr 2012  ·  21Comments  ·  Source: cucumber/cucumber-js

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.currentuserappdata\roaming\npm\cucumber.js

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

when i open c.:\ users.currentuserappdata\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

Most helpful comment

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

All 21 comments

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.

I just received this error message:

Script:

c.:\ users.currentuserappdata\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.

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

@jbpros works fine, thanks! :-)

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\releaseasync.js:133:16)
at Async._drainQueues (C:\Users\hui\AppData\Roaming\npm\node_modules\cucumbe
r\node_modules\bluebird\js\releaseasync.js:143:10)

I get the same error. Any updates on this?

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)

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

@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)

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

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

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

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

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

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

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

Hi @jbpros
I am windows user..
trying to run node_modules\cucumber\bincucumber-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

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

@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

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...

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jechazelle picture jechazelle  ·  5Comments

igniteram picture igniteram  ·  7Comments

lamartire picture lamartire  ·  6Comments

dblooman picture dblooman  ·  7Comments

ghost picture ghost  ·  7Comments