我尝试在窗口7 32位版本上安装nodejs bcrypt模块 . 我已经安装了g和openSSL
C:\mystore>npm install -g bcrypt
npm http GET https://registry.npmjs.org/bcrypt
npm http 304 https://registry.npmjs.org/bcrypt
npm http GET https://registry.npmjs.org/bindings/1.0.0
npm http 304 https://registry.npmjs.org/bindings/1.0.0
bcrypt@0.7.7安装C:\ Users \ Rajesh \ AppData \ Roaming \ npm \ node_modules \ bcrypt node-gyp rebuild
C:\Users\Rajesh\AppData\Roaming\npm\node_modules\bcrypt>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
gyp ERR! configure error
gyp ERR! stack Error: spawn ENOENT
gyp ERR! stack at errnoException (child_process.js:980:11) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:771:
34)gyp ERR!系统Windows_NT 6.1.7600 gyp ERR!命令“node”“C:\ Program Files \ nodejs \ node_modules \ npm \ node_modules \ node-gyp \ bin \ node-gyp.js”“rebuild”
gyp ERR! cwd C:\Users\Rajesh\AppData\Roaming\npm\node_modules\bcrypt
gyp ERR! node -v v0.10.20
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok
npm ERR! weird error 1
npm ERR! not ok code 0
怎么解决?
2 回答
我可以建议bcryptjs吗?
https://www.npmjs.org/package/bcryptjs
这绝对不依赖于任何事物(在节点之外) .
这很可能也有助于跨不同环境的安装
请查看下面提到的链接以供参考 .
基本步骤
安装Python 2.7.X(推荐)
安装适用于Windows桌面的Microsoft Visual Studio C 2012(Express版也可以正常运行)
安装node-gyp
为64位安装Win64OpenSSL-100e.exe,为32位安装Win32OpenSSL-100e.exe
安装brcypt模块
http://vujade.co/nodejs-environment-setup-with-bcrypt-module/