无法在Centos服务器上安装bcrypt node.js模块

问题描述:

我尝试在CentOS服务器上安装bcrypt,但我收到以下错误:

I'm trying to install bcrypt on CentOS server but I got the following error:

info postuninstall bcrypt@0.5.0
ERR! bcrypt@0.5.0 install: `make build`
ERR! `sh "-c" "make build"` failed with 2
ERR!
ERR! Failed at the bcrypt@0.5.0 install script.
ERR! This is most likely a problem with the bcrypt package,
ERR! not with npm itself.
ERR! Tell the author that this fails on your system:
ERR!     make build
ERR! You can get their info via:
ERR!     npm owner ls bcrypt
ERR! There is likely additional logging output above.
ERR!
ERR! System Linux 2.6.18-028stab095.1
ERR! command "nodejs" "/usr/bin/npm" "install" "bcrypt"
ERR! cwd /root/grouplo
ERR! node -v v0.6.15
ERR! npm -v 1.1.16
ERR! code ELIFECYCLE
ERR! message bcrypt@0.5.0 install: `make build`
ERR! message `sh "-c" "make build"` failed with 2
ERR! errno {}

我能做什么来解决这个问题?
感谢,

What Can I do to solve this? Thanks,

我在npm install bcrypt遇到了同样的问题。
其他选项是从源代码安装。

I got the same issue doing npm install bcrypt. The other option is to install it from source.

git clone git://github.com/ncb000gt/node.bcrypt.js.git
cd node.bcrypt.js
node-gyp configure
node-gyp build

将node.bcrypt.js文件夹重命名为bcrypt,并将其移动到您的项目的node_modules中。

Rename the node.bcrypt.js folder to bcrypt, and move it into your node_modules of your project.

通过执行npm install -g node-gyp(-g全局安装)安装node-gyp。

You can install node-gyp by doing npm install -g node-gyp (-g installs it globally).