Nic*_*tti 11 cygwin makefile mocha.js node.js
我正试图在Windows中运行一个应用程序,这个应用程序有一些摩卡测试.我需要制作.我看了这个
还有这个
Node.js无法找到模块 - 在Windows上干扰cygwin
我在Github目录中有应用程序(在cygwin目录结构之外),我安装了windows版本的节点.
我尝试使用PowerShell并按照建议设置别名,但我总是得到
Run Code Online (Sandbox Code Playgroud)> module.js:340 > throw err; > ^ Error: Cannot find module 'C:\cygdrive\c\Users\Nicola\AppData\Roaming\npm\node_modules\mocha\bin\mocha' > at Function.Module._resolveFilename (module.js:338:15) > at Function.Module._load (module.js:280:25) > at Module.runMain (module.js:487:10) > at process.startup.processNextTick.process._tickCallback (node.js:244:9) Makefile:5: recipe for target `test' failed make: *** > [test] Error 1
并且我在该目录中安装了mocha(BTW为什么他不在node_modules subdir中查找mocha?).问题似乎是我该C:\cygdrive\c\Users如何解决这个问题?
我也尝试将文件复制到cygwin下的home /目录但是我得到了
./node_modules/.bin/mocha: line 1: ../mocha/bin/mocha: No such file or directory
Makefile:5: recipe for target `test' failed
make: *** [test] Error 127
Run Code Online (Sandbox Code Playgroud)
我该怎么办?
当你写“make test”时,你会收到:
./node_modules/.bin/mocha: line 1: ../mocha/bin/mocha: No such file or directory
Makefile:5: recipe for target `test' failed
make: *** [test] Error 127
Run Code Online (Sandbox Code Playgroud)
这意味着您的项目中没有安装 Mocha。将 mocha 放入 package.json 并运行“npm install”:
{
"name": "appName"
, "version": "0.0.1"
, "private": true
, "dependencies": {
"mocha": "1.3.0"
, "should": "1.0.0"
}
}
Run Code Online (Sandbox Code Playgroud)
之后我在 Windows 上运行了测试。
| 归档时间: |
|
| 查看次数: |
11508 次 |
| 最近记录: |