【问题标题】:bcrypt not installing with npm (Mac OS X 10.9 - Node v0.10.22)bcrypt 不使用 npm 安装(Mac OS X 10.9 - 节点 v0.10.22)
【发布时间】:2013-11-28 04:03:49
【问题描述】:

系统规格: Mac OS X 10.9 节点 v0.10.22

尝试安装 bcrypt 时出现以下错误。有关如何解决此问题的任何建议?

任何帮助将不胜感激。

> bcrypt@0.7.6 install /Users/eDawg/Desktop/eggstage/node_modules/bcrypt
> node-gyp rebuild

  CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
../src/blowfish.cc:47:10: fatal error: 'sys/types.h' file not found
#include <sys/types.h>
         ^
1 error generated.
make: *** [Release/obj.target/bcrypt_lib/src/blowfish.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Darwin 13.0.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/eDawg/Desktop/eggstage/node_modules/bcrypt
gyp ERR! node -v v0.10.22
gyp ERR! node-gyp -v v0.11.0
gyp ERR! not ok 
npm ERR! bcrypt@0.7.6 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the bcrypt@0.7.6 install script.
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! System Darwin 13.0.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "bcrypt"
npm ERR! cwd /Users/eDawg/Desktop/eggstage
npm ERR! node -v v0.10.22
npm ERR! npm -v 1.3.14
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/eDawg/Desktop/eggstage/npm-debug.log
npm ERR! not ok code 0

【问题讨论】:

  • 过去几周我遇到了同样的问题。我能够使用节点 v0.10.22 从 npm install 成功下载 bcrypt 0.7.7。

标签: javascript macos node.js npm bcrypt


【解决方案1】:

我建议尝试使用原生 javascript 编写的bcrypt.js。显然不应该有任何构建问题。

【讨论】:

    【解决方案2】:

    我知道这个答案已经很晚了。但是对于遇到此问题的其他人,您需要确保您使用的是正确版本的 bcrypt。请参阅下表(也可以在他们的NPM page 上找到)。左边是节点版本,右边是 bcrypt 发布版本。

    0.4.x   <= 0.4.x
    0.6.x   >= 0.5.x
    0.8.x   >= 0.5.x
    0.10.x  >= 0.5.x
    0.11.x  >= 0.8.x
    

    【讨论】:

      【解决方案3】:

      在我的 Mac Mavericks 1.9 上更新 XCode 为我解决了这个问题。

      【讨论】:

        猜你喜欢
        • 2014-02-12
        • 2013-11-01
        • 1970-01-01
        • 2014-04-29
        • 2013-11-02
        • 2013-11-11
        • 2013-11-17
        • 1970-01-01
        相关资源
        最近更新 更多