bcrypt 安装错误

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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
引用中提到了一个在安装bcrypt时可能会遇到的问题。在Windows系统上安装bcrypt时,可能会收到一堆npm ERR错误。根据引用,解决这个问题的方法是安装Windows的构建工具,可以使用命令`npm install --g --production windows-build-tools`来安装。这将安装一些必要的工具和依赖,以便成功编译bcrypt。 另外,引用给出了一个使用bcrypt生成随机哈希密码的示例。可以看到,每次生成的密码都是随机的,这增加了安全性。如果您在安装bcrypt时遇到了问题,可以尝试使用上述方法来解决。 希望这能帮助您解决nodejs安装bcrypt失败的问题。如果还有其他疑问,请随时提问。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [解决windows10,nodejs 无法安装 Bcrypt](https://blog.csdn.net/weixin_40677825/article/details/119105025)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [Nodejs使用npm安装 bcrypt 提示npm ERR错误](https://blog.csdn.net/m0_73194953/article/details/127817789)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [[ Nodejs ] MD5 | Bcrypt 数据加密](https://blog.csdn.net/haodian666/article/details/126246096)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值