使用bcrypt

时间:2016-10-01 15:11:09

标签: javascript node.js meteor

您好我在使用meteor js,这很棒,但我在我的控制台上收到此消息。

W20161001-16:02:18.321(1)? (STDERR) Note: you are using a pure-JavaScript implementation of bcrypt.
W20161001-16:02:18.322(1)? (STDERR) While this implementation will work correctly, it is known to be
W20161001-16:02:18.322(1)? (STDERR) approximately three times slower than the native implementation.
W20161001-16:02:18.322(1)? (STDERR) In order to use the native implementation instead, run
W20161001-16:02:18.323(1)? (STDERR)
W20161001-16:02:18.323(1)? (STDERR)   meteor npm install --save bcrypt
W20161001-16:02:18.323(1)? (STDERR)
W20161001-16:02:18.323(1)? (STDERR) in the root directory of your application.

我全局安装了node-gyp,从包文件中删除bcrypt并运行

  

meteor npm install --save bcrypt

得到此错误

E:\Documents\Development\Projects\recipe-app\node_modules\bcrypt>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:449:14)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:404:11
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:82:15)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd E:\Documents\Development\Projects\recipe-app\node_modules\bcrypt
gyp ERR! node -v v4.6.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "bcrypt"
npm ERR! node v4.6.0
npm ERR! npm  v2.15.9
npm ERR! code ELIFECYCLE

npm ERR! bcrypt@0.8.7 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt@0.8.7 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 information on how to open an issue for this project with:
npm ERR!     npm bugs bcrypt
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
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!     E:\Documents\Development\Projects\recipe-app\npm-debug.log

不知道下一步该怎么做真的我对流星真的很新。我在使用shell的Windows 10上。 node v4.6.0任何帮助都会很棒。

2 个答案:

答案 0 :(得分:1)

您需要安装适当的构建环境来编译节点插件(例如bcrypt)。这意味着安装Python 2.7.x和某种工具链。

您可以尝试windows-build-tools模块,它将尝试通过npm安装Python和最小编译环境(或者您可以从here手动安装最小编译环境),否则仅用于工具链部分始终存在Visual C ++ Express / Community(桌面版)。

答案 1 :(得分:0)

只需卸载该软件包,然后重新安装。

meteor npm uninstall bcrypt

meteor npm install bcrypt

如果您的bcrypt版本> 2.0.0。您将再也看不到此消息。