Ubuntu 14.04
nodejs version is v4.1.1 installed with these commands:
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodejs
Run Code Online (Sandbox Code Playgroud)
mongodb installed via mongodb docs tutorial
Next I tried installing mongoose by doing
sudo npm install mongoose
Run Code Online (Sandbox Code Playgroud)
I received the following error:
> kerberos@0.0.14 install /root/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/node_modules/kerberos
> (node-gyp rebuild) || (exit 0)
gyp ERR! build error
gyp ERR! stack Error: not found: make
gyp ERR! stack at F (/usr/lib/node_modules/npm/node_modules/which/which.js:73:28)
gyp ERR! stack at E (/usr/lib/node_modules/npm/node_modules/which/which.js:76:29)
gyp ERR! …Run Code Online (Sandbox Code Playgroud) 我安装了以下内容:
包:
我有一个示例mocha测试,它将在实际运行时始终通过.
我在shell中运行的命令:
npm test
Run Code Online (Sandbox Code Playgroud)
输出:
./node_modules/mocha/bin/_mocha
'' 不被识别为内部或外部命令,可操作程序或批处理文件.错误的ERR!测试失败.请参阅上文了解更多详情.
出于某种原因,我可以直接运行此命令:
./node_modules/mocha/bin/_mocha
Run Code Online (Sandbox Code Playgroud)
结果如何
样品测试
√通过!
1次传球(4ms)
我猜这与在windows中使用类似bash的shell的怪异有关,但是我不知道如何从这里解决这个问题.
为什么会出现这种错误,是否有办法让'npm test'正常工作而不必使用这个Windows编程环境?
感谢和问候