bcrypt@1.0.3 安装:`node-pre-gyp install --fallback-to-build`
在我的 Windows 机器上安装 bcrypt 时出现此错误,我正在使用
While installing bcrypt I'm getting this error in my windows machine, I'm using
- 节点 v8.9.4
- npm v5.6.0
- bcrypt v1.0.3
C:UsersuserDesktopmysql_node_apiegister_loginegister_login>npm安装 bcrypt --save > bcrypt@1.0.3 安装C:UsersuserDesktopmysql_node_apiegister_loginegister_login ode_modulescrypt > node-pre-gyp install--fallback-to-build node-pre-gyp ERR!尝试下载(未定义):https://github.com/kelektiv/node.bcrypt.js/releases/download/v1.0.3/bcrypt_lib-v1.0.3-node-v57-win32-x64.tar.gz节点预gyp错误!未找到 bcrypt@1.0.3 和 node@8.9.4 ( node-v57 ABI) 的预构建二进制文件(回退到源代码编译节点gyp)gyp错误!配置错误gyp ERR!堆栈错误:找不到Python 可执行文件python",可以设置 PYT HON环境变量.吉普错误!堆栈在 PythonFinder.failNoPython (C:UsersuserAppDataRoaming pm ode_modules pm ode_modules ode-gyplibconfigure.js:483:19) gyp呃!PythonFinder 的堆栈.(C:UsersuserAppDataRoaming p m ode_modules pm ode_modules ode-gyplibconfigure.js:508:16) gyp呃!堆栈在C:UsersuserAppDataRoaming pm ode_modules pm ode_modulesgraceful-fspolyfills.js:284:29 gyp 错误!堆栈在FSReqWrap.oncomplete(fs.js:152:21) gyp 错误!系统 Windows_NT 6.1.7601 gyp 错误!命令C:Program Files odejs ode.exe""C:UsersuserAppData漫游 pm ode_modules pm ode_modules ode-gypin ode-gyp.js"配置" --fallback-to-build""--module=C:UsersuserDesktopmysql_node_apiegister_loginegister_login ode_modulescryptlibindingcrypt_lib.node" "--module_name=bcrypt_lib""--module_path=C:UsersuserDesktopmysql_node_apiegister_loginegister_login ode_modulescryptlibinding"吉普错误!cwd C:UsersuserDesktopmysql_node_apiegister_loginegister_login ode_modulescrypt gyp 错误!节点 -v v8.9.4 gyp 错误!节点gyp -vv3.6.2 gyp 错误!不好节点预gyp ERR!构建错误节点-pre-gyp ERR!堆栈错误:无法执行 'C:ProgramFiles odejs ode.exe C:UsersuserAppDataRoaming pm ode_modules pm ode_modules ode-gypin ode-gyp.js 配置 --fallback-to-build--module=C:UsersuserDesktopmysql_node_apiegister_loginegister_login ode_modulescryptlibindingcrypt_lib.node --module_name=bcrypt_lib --module_path=C:UsersuserDesktopmysql_node_ap iegister_loginegister_login ode_modulescryptlibinding' (1)节点预gyp错误!ChildProcess 的堆栈.(C:UsersuserDesktopmysql_node_apiegister_loginegister_login ode_modules ode-pre-gyplibutilcompile.js:83:29)节点预gyp错误!堆栈在 emitTwo (events.js:126:13)节点预gyp错误!ChildProcess.emit (events.js:214:7) 的堆栈节点预gyp呃!堆栈在可能关闭(内部/child_process.js:925:16)节点预gyp错误!Process.ChildProcess._handle.onexit 处的堆栈(internal/chi ld_process.js:209:5) node-pre-gyp ERR!系统视窗_NT6.1.7601 节点预gyp ERR!命令C:Program Files odejs ode.exe""C:UsersuserDesktopmysql_node_apiegister_loginegister_login ode_modules ode-pre-gypin ode-pre-gyp" "安装" "--fallback-to-build" node-pre-gyp呃!cwd C:UsersuserDesktopmysql_node_apiegister_loginegister_login ode_modulescrypt节点预gyp错误!node -v v8.9.4 node-pre-gyp 错误!node-pre-gyp -v v0.6.36 node-pre-gyp ERR!不行 执行失败'C:Program Files odejs ode.exe C:UsersuserAppDataRoaming pm ode_modules pm ode_modules ode-gypin ode-gyp.js 配置--fallback k-to-build --module=C:UsersuserDesktopmysql_node_apiegister_loginegister _login ode_modulescryptlibindingcrypt_lib.node --module_name=bcrypt_lib --module_path=C:UsersuserDesktopmysql_node_apiegister_loginegister_login ode_modulescryptlibinding' (1) npm 错误!代码 ELIFECYCLE npm 错误!errno 1 npm 错误!bcrypt@1.0.3 安装:node-pre-gyp 安装--fallback-to-build npm 错误!退出状态 1 npm ERR!npm 错误!bcrypt@1.0.3 安装脚本失败.npm 错误!
C:UsersuserDesktopmysql_node_apiegister_loginegister_login>npm install bcrypt --save > bcrypt@1.0.3 install C:UsersuserDesktopmysql_node_apiegister_loginegis ter_login ode_modulescrypt > node-pre-gyp install --fallback-to-build node-pre-gyp ERR! Tried to download(undefined): https://github.com/kelektiv/node .bcrypt.js/releases/download/v1.0.3/bcrypt_lib-v1.0.3-node-v57-win32-x64.tar.gz node-pre-gyp ERR! Pre-built binaries not found for bcrypt@1.0.3 and node@8.9.4 ( node-v57 ABI) (falling back to source compile with node-gyp) gyp ERR! configure error gyp ERR! stack Error: Can't find Python executable "python", you can set the PYT HON env variable. gyp ERR! stack at PythonFinder.failNoPython (C:UsersuserAppDataRoaming pm ode_modules pm ode_modules ode-gyplibconfigure.js:483:19) gyp ERR! stack at PythonFinder. (C:UsersuserAppDataRoaming p m ode_modules pm ode_modules ode-gyplibconfigure.js:508:16) gyp ERR! stack at C:UsersuserAppDataRoaming pm ode_modules pm ode_mo dulesgraceful-fspolyfills.js:284:29 gyp ERR! stack at FSReqWrap.oncomplete (fs.js:152:21) gyp ERR! System Windows_NT 6.1.7601 gyp ERR! command "C:Program Files odejs ode.exe" "C:UsersuserAppData Roaming pm ode_modules pm ode_modules ode-gypin ode-gyp.js" "co nfigure" "--fallback-to-build" "--module=C:UsersuserDesktopmysql_node_ap iegister_loginegister_login ode_modulescryptlibindingcrypt_li b.node" "--module_name=bcrypt_lib" "--module_path=C:UsersuserDesktopmysq l_node_apiegister_loginegister_login ode_modulescryptlibinding" gyp ERR! cwd C:UsersuserDesktopmysql_node_apiegister_loginegister_login node_modulescrypt gyp ERR! node -v v8.9.4 gyp ERR! node-gyp -v v3.6.2 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute 'C:Program Files odejs ode.e xe C:UsersuserAppDataRoaming pm ode_modules pm ode_modules ode-gypin node-gyp.js configure --fallback-to-build --module=C:UsersuserDesktopmysql_n ode_apiegister_loginegister_login ode_modulescryptlibindingcrypt_lib .node --module_name=bcrypt_lib --module_path=C:UsersuserDesktopmysql_node_ap iegister_loginegister_login ode_modulescryptlibinding' (1) node-pre-gyp ERR! stack at ChildProcess. (C:UsersuserDesktopm ysql_node_apiegister_loginegister_login ode_modules ode-pre-gyplibutilc ompile.js:83:29) node-pre-gyp ERR! stack at emitTwo (events.js:126:13) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:214:7) node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:925:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/chi ld_process.js:209:5) node-pre-gyp ERR! System Windows_NT 6.1.7601 node-pre-gyp ERR! command "C:Program Files odejs ode.exe" "C:Usersuser Desktopmysql_node_apiegister_loginegister_login ode_modules ode-pr e-gypin ode-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd C:UsersuserDesktopmysql_node_apiegister_loginegist er_login ode_modulescrypt node-pre-gyp ERR! node -v v8.9.4 node-pre-gyp ERR! node-pre-gyp -v v0.6.36 node-pre-gyp ERR! not ok Failed to execute 'C:Program Files odejs ode.exe C:UsersuserAppDataRoamin g pm ode_modules pm ode_modules ode-gypin ode-gyp.js configure --fallbac k-to-build --module=C:UsersuserDesktopmysql_node_apiegister_loginegister _login ode_modulescryptlibindingcrypt_lib.node --module_name=bcrypt_lib --module_path=C:UsersuserDesktopmysql_node_apiegister_loginegister_login ode_modulescryptlibinding' (1) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! bcrypt@1.0.3 install: node-pre-gyp install --fallback-to-build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the bcrypt@1.0.3 install script. npm ERR!
这可能不是 npm 的问题.上面可能有额外的日志输出.npm 错误!本次运行的完整日志可以在:npm ERR!C:UsersuserAppDataRoaming pm-cache_logs2018-02-25T14_42_29_529Z-debug.log
This is probably not a problem with npm. There is likely additional log ging output above. npm ERR! A complete log of this run can be found in: npm ERR! C:UsersuserAppDataRoaming pm-cache_logs2018-02-25T14_42_29_5 29Z-debug.log
推荐答案
我在使用 node v14.x 时也遇到了这个错误.我发现 bcrypt v1.0.3 的预构建二进制文件不适用于节点 v14.要修复它,我必须安装不同的 bcrypt 版本.
I also encountered this error im using node v14.x. I found out that the pre-built binaries of bcrypt v1.0.3 is not available for node v14. To fix it, I have to install a different bcrypt version.
npm uninstall bcrypt --save
npm install bcrypt@5 --save
就是这样.现在可以了!
That's it. It works now!
相关文章