【问题标题】:Failed at the bcrypt@3.0.2 install scriptbcrypt@3.0.2 安装脚本失败
【发布时间】: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


【解决方案1】:

official repository 上有很多关于此的错误报告 - 您是否确定已阅读此库的完整 installation instructions,包括一些构建工具的安装?也许在具有管理员权限的命令行中运行以下行已经有帮助?

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

【讨论】:

  • 是的,我已经完成了所有这些,甚至尝试了您提到的命令,但它也显示了类似的错误,我认为主要错误是这个 - npm ERR! This is probably not a problem with npm, There is likely additional logging output above
  • 那么检查完整的日志文件呢?也许它列出了更多信息
  • 我也检查过了,我无法从中得到太多,``` EventEmitter 的 1222 详细堆栈。 EventEmitter.emit 的 1222 详细堆栈 (events.js:189:13 ) ChildProcess 处的 1222 个详细堆栈。 (C:\Users\Ansh\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14) ChildProcess 处的 1222 个详细堆栈。在可能关闭时发出 (events.js:189:13) 1222 详细堆栈 (internal/child_process.js:970:16) 在 Process.ChildProcess._handle.onexit (internal/child_process.js:259:5) 处发出 1222 详细堆栈`
【解决方案2】:

你好,试试这个命令行也许对你有帮助

npm install bcrypt@3 --save

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-03
    • 2014-04-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-02-11
    相关资源
    最近更新 更多