首页 > 解决方案 > 安装 NPM 包时遇到错误

问题描述

当我尝试通过 NPM 安装 bcrypt 时,出现此错误:

npm ERR! code 127
npm ERR! path Z:\Authentication-Service\node_modules\bcrypt
npm ERR! command failed
npm ERR! command bash -c node-pre-gyp install --fallback-to-build
npm ERR! /mnt/z/Authentication-Service/node_modules/.bin/node-pre-gyp: 11: exec: node: not found

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Xandrrrr\AppData\Local\npm-cache\_logs\2021-08-23T23_15_39_915Z-debug.log

我已经尝试过的:

我的版本:

标签: node.jsnpmbcryptnode-pre-gyp

解决方案


Node v16.7.0 is not the LTS version.

May be it has deprecated some features that bcrypt requires (but I'm not sure)!

Try downgrading Node to the current LTS version v14.17.6


推荐阅读