我正在 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
最佳答案
可能不是解决问题的最佳方法,但我安装了 cygwin 并通过它运行了我所有的 jasmine 命令。在 Windows 中通过命令行使用 jasmine 等模块时让生活更轻松。
关于node.js - Jasmine Node 不适用于 Windows,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24680889/