求助npm install bcrypt问题,有关于node-nodegyp rebuild 报错

node 报错: bcrypt 无法 install_问答_ThinkSAAS
node 报错: bcrypt 无法 install
node 报错: bcrypt 无法 install
使用中遇到以下错误:
? Hime git:(master) npm install
install /Users/yanhan/Hime/node_modules/bcrypt
& node-gyp rebuild
然后启动 mongodb:
mongod --dbpath /usr/local/var/mongodb/
T11:58:15.079+0800 I JOURNAL [initandlisten] journal dir=/usr/local/var/mongodb/journal
T11:58:15.080+0800 I JOURNAL [initandlisten] recover : no journal files present, no recovery needed
T11:58:15.095+0800 I JOURNAL [durability] Durability thread started
最后想要使用 node bin/run 报错:
? Hime git:(master) node bin/www
{ [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' }
js-bson: Failed to load c++ bson extension, using pure JS version
{ [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' }
js-bson: Failed to load c++ bson extension, using pure JS version
{ [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' }
js-bson: Failed to load c++ bson extension, using pure JS version
{ [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' }
js-bson: Failed to load c++ bson extension, using pure JS version
/Users/yanhan/Hime/node_modules/mongodb/lib/server.js:274
process.nextTick(function() { })
Error: Could not locate the bindings file. Tried:
→ /Users/yanhan/Hime/node_modules/bcrypt/build/bcrypt_lib.node
→ /Users/yanhan/Hime/node_modules/bcrypt/build/Debug/bcrypt_lib.node
→ /Users/yanhan/Hime/node_modules/bcrypt/build/Release/bcrypt_lib.node
→ /Users/yanhan/Hime/node_modules/bcrypt/out/Debug/bcrypt_lib.node
→ /Users/yanhan/Hime/node_modules/bcrypt/Debug/bcrypt_lib.node
→ /Users/yanhan/Hime/node_modules/bcrypt/out/Release/bcrypt_lib.node
→ /Users/yanhan/Hime/node_modules/bcrypt/Release/bcrypt_lib.node
→ /Users/yanhan/Hime/node_modules/bcrypt/build/default/bcrypt_lib.node
→ /Users/yanhan/Hime/node_modules/bcrypt/compiled/0.12.4/darwin/x64/bcrypt_lib.node
at bindings (/Users/yanhan/Hime/node_modules/bcrypt/node_modules/bindings/bindings.js:88:9)
at Object.&anonymous& (/Users/yanhan/Hime/node_modules/bcrypt/bcrypt.js:3:35)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.&anonymous& (/Users/yanhan/Hime/common/util.js:1:76)
at Module._compile (module.js:460:26)
搜索了一下之后参考了stack overflow 上这个答案
但是还是不行。几个方法都试过了(包括改 index.js 里面的 bson 路径)
目前不确定到底是 bson 问题?还是 mogondb?还是?
谢谢帮助。
=================================
用 cnpm 重试,报错如下:
? Hime git:(master) rimraf node_modules/
? Hime git:(master) cnpm cache clean
? Hime git:(master) cnpm install
install /Users/yanhan/Hime/node_modules/bcrypt
& node-gyp rebuild
gyp: /Users/yanhan/.node-gyp/0.12.4/common.gypi not found (cwd: /Users/yanhan/Hime/node_modules/bcrypt) while reading includes of binding.gyp 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/local/lib/node_modules/cnpm/node_modules/pangyp/lib/configure.js:345:16)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Darwin 14.3.0
gyp ERR! command"node""/usr/local/lib/node_modules/cnpm/node_modules/pangyp/bin/node-gyp.js""rebuild"
gyp ERR! cwd /Users/yanhan/Hime/node_modules/bcrypt
gyp ERR! node -v v0.12.4
gyp ERR! pangyp -v v2.1.0
gyp ERR! not ok
install /Users/yanhan/Hime/node_modules/mongodb/node_modules/mongodb-core/node_modules/kerberos
& (node-gyp rebuild 2& builderror.log) || (exit 0)
npm WARN installMany nopt was bundled with , but bundled package wasn't found in unpacked tree
npm WARN installMany npmlog was bundled with , but bundled package wasn't found in unpacked tree
npm WARN installMany request was bundled with , but bundled package wasn't found in unpacked tree
npm WARN installMany semver was bundled with , but bundled package wasn't found in unpacked tree
npm WARN installMany tar was bundled with , but bundled package wasn't found in unpacked tree
npm WARN installMany tar-pack was bundled with , but bundled package wasn't found in unpacked tree
npm WARN installMany mkdirp was bundled with , but bundled package wasn't found in unpacked tree
npm WARN installMany rc was bundled with , but bundled package wasn't found in unpacked tree
npm WARN installMany rimraf was bundled with , but bundled package wasn't found in unpacked tree
install /Users/yanhan/Hime/node_modules/mongodb/node_modules/mongodb-core/node_modules/bson/node_modules/bson-ext
& (node-pre-gyp install --fallback-to-build) || (node-gyp rebuild 2& builderror.log) || (exit 0)
gyp: /Users/yanhan/.node-gyp/0.12.4/common.gypi not found (cwd: /Users/yanhan/Hime/node_modules/mongodb/node_modules/mongodb-core/node_modules/bson/node_modules/bson-ext) while reading includes of binding.gyp 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/local/lib/node_modules/cnpm/node_modules/pangyp/lib/configure.js:345:16)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Darwin 14.3.0
gyp ERR! command"/usr/local/Cellar/node/0.12.4/bin/node""/usr/local/lib/node_modules/cnpm/node_modules/pangyp/bin/node-gyp.js""configure""--fallback-to-build""--module=/Users/yanhan/Hime/node_modules/mongodb/node_modules/mongodb-core/node_modules/bson/node_modules/bson-ext/build/Release/bson.node""--module_name=bson""--module_path=/Users/yanhan/Hime/node_modules/mongodb/node_modules/mongodb-core/node_modules/bson/node_modules/bson-ext/build/Release"
gyp ERR! cwd /Users/yanhan/Hime/node_modules/mongodb/node_modules/mongodb-core/node_modules/bson/node_modules/bson-ext
gyp ERR! node -v v0.12.4
gyp ERR! pangyp -v v2.1.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/Cellar/node/0.12.4/bin/node /usr/local/lib/node_modules/cnpm/node_modules/pangyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/yanhan/Hime/node_modules/mongodb/node_modules/mongodb-core/node_modules/bson/node_modules/bson-ext/build/Release/bson.node --module_name=bson --module_path=/Users/yanhan/Hime/node_modules/mongodb/node_modules/mongodb-core/node_modules/bson/node_modules/bson-ext/build/Release' (1)
node-pre-gyp ERR! stack at ChildProcess.&anonymous& (/Users/yanhan/Hime/node_modules/mongodb/node_modules/mongodb-core/node_modules/bson/node_modules/bson-ext/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:110:17)
node-pre-gyp ERR! stack at maybeClose (child_process.js:1015:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
node-pre-gyp ERR! System Darwin 14.3.0
node-pre-gyp ERR! command"node""/Users/yanhan/Hime/node_modules/mongodb/node_modules/mongodb-core/node_modules/bson/node_modules/bson-ext/node_modules/.bin/node-pre-gyp""install""--fallback-to-build"
node-pre-gyp ERR! cwd /Users/yanhan/Hime/node_modules/mongodb/node_modules/mongodb-core/node_modules/bson/node_modules/bson-ext
node-pre-gyp ERR! node -v v0.12.4
node-pre-gyp ERR! node-pre-gyp -v v0.6.4
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/Cellar/node/0.12.4/bin/node /usr/local/lib/node_modules/cnpm/node_modules/pangyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/yanhan/Hime/node_modules/mongodb/node_modules/mongodb-core/node_modules/bson/node_modules/bson-ext/build/Release/bson.node --module_name=bson --module_path=/Users/yanhan/Hime/node_modules/mongodb/node_modules/mongodb-core/node_modules/bson/node_modules/bson-ext/build/Release' (1)
npm ERR! Darwin 14.3.0
npm ERR! argv"node""/usr/local/lib/node_modules/cnpm/node_modules/.bin/npm""--userconfig=/Users/yanhan/.cnpmrc""--disturl=https://npm.taobao.org/mirrors/node""--cache=/Users/yanhan/.cnpm""--registry=https://registry.npm.taobao.org""--node-gyp=/usr/local/lib/node_modules/cnpm/node_modules/pangyp/bin/node-gyp.js""install"
npm ERR! node v0.12.4
npm ERR! npm v2.7.6
npm ERR! code ELIFECYCLE
install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! Failed at the
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! /Users/yanhan/Hime/npm-debug.log
删~/.node_gyp,重装。
添加你想要问的问题
PHP开发框架
开发工具/编程工具
服务器环境
ThinkSAAS商业授权:
ThinkSAAS为用户提供有偿个性定制开发服务
ThinkSAAS将为商业授权用户提供二次开发指导和技术支持
让ThinkSAAS更好,把建议拿来。
开发客服微信关于在npm中安装bcrypt插件的问题 - CNode技术社区
这家伙很懒,什么个性签名都没有留下。
我的电脑上已经配置好了python2.7.3的环境,可是在执行npm install bcrypt --save的时候还是报错,错误如下:
注:之前也在网上百度过关于npm install bcrypt问题,解决方案有3个,可是都没有成功
**阅读这里
问题就解决了**
我安装了这个插件,可并没有任何作用
window 下安装bcrypt 必须要先 node-gyp
1:npm install -g node-gyp
这个东西需要python git上推荐用2.7.3版本.
我这样做了可是也没有作用
又百度到一个方法 npm install bcrypt-nodejs --save-dev
可是仍然没有作用
最终报的都是如图所示的错误
希望大家帮帮忙,帮我看一下到底是哪里的错误,谢谢啦!
安装bcrypt-nodejs后要更改require的包名
噢噢!!可以了可以了,就是忘了更改包名,太感谢了!!!
上面的方法都试过,同样无效。。。请问你是如何解决的?如何更改require的包名?
require(“bcrypt”)改为require(“bcrypt-nodejs”)。。。
CNode 社区为国内最专业的 Node.js 开源技术社区,致力于 Node.js 的技术研究。
服务器赞助商为
,存储赞助商为
,由提供应用性能服务。
新手搭建 Node.js 服务器,推荐使用无需备案的}

我要回帖

更多关于 nw gyp rebuild 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信