运行此命令时遇到问题 istanbul cover _mocha 引发错误如下:
No coverage information was collected, exit without writing coverage information
C:\Users\mhass\AppData\Roaming\npm\_mocha.CMD:1
(function (exports, require, module, __filename, __dirname) { @IF EXIST "%~dp0\node.exe" (
^
SyntaxError: Invalid or unexpected token
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Object.Module._extensions.(anonymous function) [as .js] (C:\Users\mhass\AppData\Roaming\npm\node_modules\istanbul\lib\hook.js:109:37)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Function.Module.runMain (module.js:604:10)
at runFn (C:\Users\mhass\AppData\Roaming\npm\node_modules\istanbul\lib\command\common\run-with-cover.js:122:16)