我无法安装bcrypt

问题描述 投票:0回答:1

我尝试了几种解决方案。像

  npm install --global --production windows-build-tools

  npm install node-gyp -g 

尝试之前

  npm install bcrypt 

但仍然显示此错误。

> [email protected] install C:\Users\Ethel\AppData\Roaming\npm\node_modules                                                                                                  
\bcrypt
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using needle for node-pre-gyp https download
node-pre-gyp WARN Tried to download(404): https://github.com/kelektiv/                                                                                                  
node.bcrypt.js/releases/download/v4.0.1/bcrypt_lib-v4.0.1-napi-v3-win3                                                                                                  
2-x64-unknown.tar.gz
node-pre-gyp WARN Pre-built binaries not found for [email protected] and no                                                                                                  
[email protected] (node-v72 ABI, unknown) (falling back to source compile wit                                                                                                  
h node-gyp)
gyp ERR! find Python
gyp ERR! find Python Python is not set from command line or npm config                                                                                                  
uration
gyp ERR! find Python Python is not set from environment variable PYTHO                                                                                                  
N
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - "python" is not in PATH or produced an error
gyp ERR! find Python checking if "python2" can be used
gyp ERR! find Python - "python2" is not in PATH or produced an error
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - "python3" is not in PATH or produced an error
gyp ERR! find Python checking if the py launcher can be used to find P                                                                                                  
ython 2
hel\AppData\Roaming\npm\node_modules\bc                                                                                                  
rypt\lib\binding\napi-v3 --napi_version=5 --node_abi_napi=napi --napi_                                                                                                  
build_version=3 --node_napi_label=napi-v3' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-bui                                                                                                  
ld`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely addi                                                                                                  
tional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Ethel\AppData\Roaming\npm-cache\_logs\2020-03-09                                                                                                  
T01_40_45_056Z-debug.log

我只需要在这里减少错误,但是在这里发布太久了。谁知道我该怎么办?预先谢谢你

node.js npm bcrypt
1个回答
0
投票

错误提示您的路径中缺少python。似乎该软件包需要python来构建。

gyp ERR! find Python - "python" is not in PATH or produced an error

在命令行中输入python,然后查看它是否启动了python REPL。如果没有,请安装python,确保它在您的路径中,然后尝试再次安装该软件包。

© www.soinside.com 2019 - 2024. All rights reserved.