bcrypt 安装错误

这篇博客主要讨论了在npm安装bcrypt模块时遇到的错误,错误代码为ELIFECYCLE和9009。解决方案包括确保系统中Python路径正确,安装windows-build-tools和node-gyp,或者切换到纯JavaScript实现的bcryptjs。提供了详细的步骤和替代方案。
摘要由CSDN通过智能技术生成

Error

npm ERR! code ELIFECYCLE
npm ERR! errno 9009
npm ERR! bcrypt@5.0.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 9009
npm ERR!
npm ERR! Failed at the bcrypt@5.0.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.


Solution1

Reason for Error : Node maybe can’t able to find the Python path on your system

step: 1 Rum command prompt as administrator step 2 Install the package

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

It may take some while, keep patient

step 3 Now install

npm install node-gyp

Last step Now you are ready to Go

npm install bcrypt

Solution2

The easy solution is just switch from the "bcrypt" npm module to bycryptjs or bcrypt-nodejs.

It's the exact same API, but pure JS so no native add-ons to deal with.

npm install --save bcryptjs && npm uninstall --save bcrypt

Then change your require calls to "bcryptjs", but all your code otherwise can be unchanged.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值