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

Unexpected Token Case #500

Closed
khrome83 opened this issue Dec 9, 2015 · 5 comments
Closed

Unexpected Token Case #500

khrome83 opened this issue Dec 9, 2015 · 5 comments

Comments

@khrome83
Copy link

khrome83 commented Dec 9, 2015

Every time I run a command like -
'node ./node_modules/.bin/istanbul check-coverage'

I get the following error -

C:\Users\zanem\Documents\GitHub\impressjs\node_modules\.bin\istanbul:4
case `uname` in
^^^^

SyntaxError: Unexpected token case
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:404:25)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Function.Module.runMain (module.js:457:10)
    at startup (node.js:136:18)
    at node.js:972:3

If I run this with Mocha, then it reports the same issue, but states that it happening in _mocha:4 instead.

This happens when I try to setup Istanbul to run cover over mocha. It happens when I just try and run Istanbul. I am at a loss and can't find anything about this anywhere.

Help please!

@khrome83
Copy link
Author

Appears that the path to mocha was valid in unix but not in windows.

./node_modules/mocha/bin/_mocha changing to this solved the problem. While I could call Istanbul from ./bin/Istanbul, I could not call mocha from the same location.

@lippea
Copy link

lippea commented Jan 20, 2016

I have the same problem. And tried with .\node_modules.bin_mocha, still "SyntaxError: Unexpected token case" How can I fix it?

node_modules\.bin\istanbul cover .\node_modules\.bin\_mocha -- --compilers js:babel/register
No coverage information was collected, exit without writing coverage information
D:\source\responsive-ui\node_modules\.bin\_mocha:4
case `uname` in
^^^^

SyntaxError: Unexpected token case
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:414:25)
    at Object.Module._extensions..js (module.js:442:10)
    at Object.Module._extensions.(anonymous function) [as .js] (D:\source\responsive-ui\node_modules\istanbul\lib\hook.js:109:37)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Function.Module.runMain (module.js:467:10)
    at runFn (D:\source\responsive-ui\node_modules\istanbul\lib\command\common\run-with-cover.js:122:16)
    at D:\source\responsive-ui\node_modules\istanbul\lib\command\common\run-with-cover.js:251:17
    at D:\source\responsive-ui\node_modules\istanbul\lib\util\file-matcher.js:68:16

@lippea
Copy link

lippea commented Jan 20, 2016

Solved by running "istanbul cover node_modules\mocha\bin\mocha -- --compilers js:babel/register --recursive". But received "No coverage information was collected, exit without writing coverage information".

@lippea
Copy link

lippea commented Jan 20, 2016

Finally successful by running "istanbul cover node_modules\mocha\bin_mocha -- --compilers js:babel/register --recursive"

@CerenaNirmal
Copy link

where do you change the patch? How to change the path? Should we place the config file there or should we manually change the execution path? Please help..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants