我正在windows上运行jasmine-node测试。我的package.json中有以下命令。
"scripts": {
"test": "./node_modules/.bin/jasmine-node --coffee sample_spec.coffee",
}当我运行npm test时,我得到以下错误:
TypeError: Cannot read property '1' of null
at Object.<anonymous> (C:\Documents and Settings\rohan\RubymineProjects\Node
Demo\node_modules\jasmine-node\lib\jasmine-node\index.js:24:57)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (C:\Documents and Settings\rohan\RubymineProjects\Node
Demo\node_modules\jasmine-node\lib\jasmine-node\cli.js:1:77)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
npm ERR! Test failed. See above for more details.
npm ERR! not ok code 0发布于 2015-07-07 01:29:48
可能不是解决这个问题的最好方法,但我安装了cygwin,并通过它运行了我所有的jasmine命令。在Windows中通过命令行使用像jasmine这样的模块时,使工作变得更容易。
发布于 2018-04-12 17:48:21
所以在花了几个小时的时间之后,我找到了原因和解决方案https://github.com/json5/json5/issues/4#issuecomment-5967750
我们必须在窗口中更新npm :)
https://stackoverflow.com/questions/24680889
复制相似问题