node.js - Unexpected token ILLEGAL - istanbul test _mocha -


related questions:

  1. does know module.js error talks is?

just found here

  1. it looks module.js load function thinks command '.js' file. how can add extension handlers '.cmd' files?

???


after creating project using yo , generator-gulpplugin-coffee, have run issue straight away command npm test

the full command listed in base package.json "test" paramater

coffeelint gulpfile.coffee index.coffee test -f ./coffeelint.json && istanbul test _mocha --report lcovonly -- ./test/*.coffee --require coffee-script/register --reporter spec 

the coffeelint works fine when extract command , run it, istanbul test _mocha... fails unexpected token illegal error @ '@' symbol in _mocha.cmd file:

$ npm test  > gulp-ember-template-compiler-2@0.0.0 test c:\users\me\code\something > coffeelint gulpfile.coffee index.coffee test -f ./coffeelint.json && istanbul test _mocha --report lcovonly -- ./test/*.coffee --require coffee-script/register --reporter spec    ✓ gulpfile.coffee   ✓ index.coffee   ✓ test/main.coffee  ✓ ok! » 0 errors , 0 warnings in 3 files  c:\users\me\code\something\node_modules\.bin\_mocha.cmd:1 (function (exports, require, module, __filename, __dirname) { @if exist "%~dp0                                                               ^ syntaxerror: unexpected token illegal     @ exports.runinthiscontext (vm.js:73:16)     @ module._compile (module.js:443:25)     @ object.module._extensions..js (module.js:478:10)     @ module.load (module.js:355:32)     @ function.module._load (module.js:310:12)     @ function.module.runmain (module.js:501:10)     @ runfn (c:\users\me\code\something\node_modules\istanbul\lib\command\common\run-with-cover.js:122:16)     @ object.run (c:\users\me\code\something\node_modules\istanbul\lib\command\common\run-with-cover.js:254:9)     @ testcommand.command.mix.run (c:\users\me\code\something\node_modules\istanbul\lib\command\test.js:27:22)     @ runcommand (c:\users\me\code\something\node_modules\istanbul\lib\cli.js:78:19) 

i've tried updating libraries without success, here package.json:

{   "name": "dadeda",   "version": "0.0.0",   "description": "a plugin gulp",   "keywords": [     "gulpplugin"   ],   "repository": "me/dadeda",   "author": {     "name": "me",     "email": "me@there.com",     "url": "http://methere.com"   },   "files": [     "index.js"   ],   "scripts": {     "prepublish": "gulp coffee --require coffee-script/register",     "test": "coffeelint gulpfile.coffee index.coffee test -f ./coffeelint.json && istanbul test _mocha --report lcovonly -- ./test/*.coffee --require coffee-script/register --reporter spec",     "coveralls": "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"   },   "dependencies": {     "gulp-util": "^3.0.0",     "through2": "^0.6.1"   },   "devdependencies": {     "coffee-script": "^1.7.1",     "coffeelint": "^1.4.0",     "coveralls": "^2.8.0",     "del": "^1.2.1",     "gulp": "^3.5.2",     "gulp-coffee": "^2.1.2",     "istanbul": "^0.3.19",     "mocha": "^2.2.5",     "should": "^7.1.0"   },   "engines": {     "node": ">=0.10.0",     "npm": ">=1.3.7"   },   "license": "mit" } 

i using windows 10, node 0.12.7, npm 2.11.3.

this issue on windows machines can't execute _mocha file javascript - have identified.

the workaround pass full path of mocha file (as described in this issue):

istanbul test node_modules/mocha/bin/_mocha 

Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -