请问在ubuntu14.0和 alinode 4.0.0基础上安装nodeclub,bcrypt报错问题如何解决的?
发布于 9 年前 作者 supergfox 3957 次浏览 最后一次编辑是 8 年前 来自 问答

下面是错误明细,我在一个新目录中使用npm install bcrypt也是一样的报错。我也通过 npm install nan 安装了。

bcrypt@0.8.5 install /usr/test/nodeclub/node_modules/bcrypt node-gyp rebuild

/bin/sh: 1: node: Permission denied gyp: Call to ‘node -e “require(‘nan’)”’ returned exit status 127. while trying to load binding.gyp gyp ERR! configure error gyp ERR! stack Error: gyp failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:431:16) gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:797:12) gyp ERR! System Linux 3.16.0-30-generic gyp ERR! command “nodejs” “/usr/bin/node-gyp” "rebuild" gyp ERR! cwd /usr/test/nodeclub/node_modules/bcrypt gyp ERR! node -v v0.10.25 gyp ERR! node-gyp -v v0.10.10 gyp ERR! not ok npm ERR! Linux 3.16.0-30-generic npm ERR! argv “/root/nvm/versions/alinode/v4.0.0/bin/node” “/root/nvm/versions/alinode/v4.0.0/bin/npm” “install” "" npm ERR! node v4.0.0 npm ERR! npm v2.14.2 npm ERR! code ELIFECYCLE

npm ERR! bcrypt@0.8.5 install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the bcrypt@0.8.5 install script ‘node-gyp rebuild’. npm ERR! This is most likely a problem with the bcrypt package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-gyp rebuild npm ERR! You can get their info via: npm ERR! npm owner ls bcrypt npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /usr/test/nodeclub/npm-debug.log make: *** [install] 错误 1

6 回复

重新安装最新版Python试试 了没?还有 node-gyp

@pangguoming Python 2.7.6 (default, Mar 22 2014, 22:59:56) [GCC 4.8.2] on linux2 Type “help”, “copyright”, “credits” or “license” for more information. python已装。 node-gyp install的时候出现问题了 npm install -g node-gyp npm ERR! Linux 3.16.0-30-generic npm ERR! argv “/root/nvm/versions/alinode/v4.0.0/bin/node” “/root/nvm/versions/alinode/v4.0.0/bin/npm” “install” “-g” "node-gyp" npm ERR! node v4.0.0 npm ERR! npm v2.14.2

npm ERR! shasum check failed for /tmp/npm-5489-5ecb4107/registry.npmjs.org/glob/-/glob-5.0.14.tgz npm ERR! Expected: a811d507acb605441edd6cd2622a3c6f06cc00e1 npm ERR! Actual: da39a3ee5e6b4b0d3255bfef95601890afd80709 npm ERR! From: https://registry.npmjs.org/glob/-/glob-5.0.14.tgz npm ERR! npm ERR! If you need help, you may report this error at: npm ERR! https://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request: npm ERR! /root/npm-debug.log 这个是不是与我的放置目录有关?

我换了/home下的目录终于安装node-gyp没有报错了! 安装bcrypt发现他在找原来root下的目录,然后报错

bcrypt@0.8.5 install /root/nvm/versions/node/v4.0.0/lib/node_modules/bcrypt node-gyp rebuild

gyp ERR! configure error gyp ERR! stack Error: spawn ENOENT gyp ERR! stack at errnoException (child_process.js:988:11) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:779:34)

全部重新更换目录后的最新提示错误如下 还是关于bcrypt bcrypt@0.8.5 install /home/greatfox/nodeclub/node_modules/bcrypt

node-gyp rebuild

gyp ERR! configure error gyp ERR! stack Error: spawn ENOENT gyp ERR! stack at errnoException (child_process.js:988:11) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:779:34) gyp ERR! System Linux 3.16.0-30-generic gyp ERR! command “nodejs” “/usr/bin/node-gyp” "rebuild" gyp ERR! cwd /home/greatfox/nodeclub/node_modules/bcrypt gyp ERR! node -v v0.10.25 gyp ERR! node-gyp -v v0.10.10 gyp ERR! not ok npm WARN This failure might be due to the use of legacy binary "node" npm WARN For further explanations, please read /usr/share/doc/nodejs/README.Debian

搞定了吗? 试试 npm install node-gyp -g --unsafe-perm

我看 travisci 是好的

回到顶部