gpt4 book ai didi

javascript - 使用 bcrypt 的纯 JavaScript 实现

转载 作者:行者123 更新时间:2023-12-03 05:59:22 24 4
gpt4 key购买 nike

您好,我正在使用 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

不知道下一步该做什么,我真的对 meteor 很陌生。我在 Windows 10 上使用 shell。 Node v4.6.0 任何帮助都会很棒。

最佳答案

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

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

关于javascript - 使用 bcrypt 的纯 JavaScript 实现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39808176/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com