【发布时间】:2012-07-23 00:12:32
【问题描述】:
我正在尝试在 Windows 中运行一个应用程序,这个应用程序有一些 mocha 测试。我需要制作。我读了这个
Mocha requires make. Can't find a make.exe that works on Windows
还有这个
Node.js cannot find module - interfering with cygwin on Windows
我在 Github 目录(cygwin 目录结构之外)中有应用程序,并且我安装了 windows 版本的 node.js。
我尝试使用 powershell 并按照建议设置别名,但我总是得到 p>
> 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(顺便说一句,他为什么不在 node_modules 子目录中查找 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
我该怎么办?
【问题讨论】:
-
请考虑接受@Bwaxxio 的正确答案!它可以工作并且不需要我更改操作系统。 :)
标签: node.js makefile cygwin mocha.js