【发布时间】:2019-07-24 19:10:50
【问题描述】:
我正在为我的项目安装 bcrypt 以使用以下命令在哈希函数中使用盐渍 -
npm i bcrypt@3.0.2
我当前的节点版本是 10.16.0 我已安装 nvm 以从 10.15.3 更新我以前的节点版本
但在安装时出现这些错误-
"node" is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bcrypt@3.0.2 install: "node-pre-gyp install --fallback-to-build"
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt@3.0.2 install script
npm ERR! This is probably not a problem with npm, There is likely additional logging output above.
npm ERR! A complete log og this run can be found in:
npm ERR! C:Users\Ansh\AppData\Roaming\npm-cache\_logs\2019-06-17T06_05_15-252Z-debug.log
更新 我已经设法安装了 bcrypt 包,但提到的问题仍然存在。实际上,我使用的是 Windows 操作系统,并且为了运行这些命令,我使用 Hyper 作为终端,这会产生这些错误。我尝试通过 PowerShell 使用管理权限运行 bcrypt install 命令,它成功了,没有任何错误。
我尝试通过 Hyper 安装更多软件包(如护照、快速会话等),但遇到了一些类似的错误,但是当我在 PowerShell 中运行这些软件包时,它工作得很好。
我已经设法让事情为我工作,但我仍然不明白这背后的逻辑。如果有人对此有任何想法,请分享,然后我可以关闭它。
【问题讨论】:
-
你看过完整的日志吗?那么使用最新版本的
bcrypt怎么样?
标签: node.js node-modules bcrypt