小编Caf*_*ten的帖子

npm install mongoose causes gyp and kerberos errors (gssapi/gssapi.h file not found)

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)

ubuntu kerberos mongoose node.js node-gyp

16
推荐指数
1
解决办法
9460
查看次数

为什么运行npm test会导致:'.' 不被识别为内部或外部命令,可操作程序或批处理文件.

我安装了以下内容:

  • Windows 10
  • Git bash(mingw64)
  • Node.js v8.7.0
  • npm版本5.4.2

包:

  • 柴4.4.1
  • 摩卡3.5.0

我有一个示例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编程环境?

感谢和问候

windows bash mocha.js npm mingw-w64

3
推荐指数
1
解决办法
2292
查看次数

标签 统计

bash ×1

kerberos ×1

mingw-w64 ×1

mocha.js ×1

mongoose ×1

node-gyp ×1

node.js ×1

npm ×1

ubuntu ×1

windows ×1