安装“npm install -g heroku”时出现 npm 调试升级问题

Posted

技术标签:

【中文标题】安装“npm install -g heroku”时出现 npm 调试升级问题【英文标题】:npm debug upgrade issue when installing "npm install -g heroku" 【发布时间】:2021-04-11 14:29:51 【问题描述】:

每次我在终端运行“npm install -g heroku”时都会弹出这个错误

npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated debug@4.1.0: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated debug@3.2.6: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)

> yarn@1.22.10 preinstall /usr/local/lib/node_modules/heroku/node_modules/yarn
> :; (node ./preinstall.js > /dev/null 2>&1 || true)

npm ERR! code EEXIST
npm ERR! syscall symlink
npm ERR! path ../lib/node_modules/heroku/bin/run
npm ERR! dest /usr/local/bin/heroku
npm ERR! errno -17
npm ERR! EEXIST: file already exists, symlink '../lib/node_modules/heroku/bin/run' -> '/usr/local/bin/heroku'
npm ERR! File exists: /usr/local/bin/heroku
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/peter/.npm/_logs/2021-01-05T19_51_17_072Z-debug.log

我尝试在终端中更新 Debug 版本但没有成功,任何建议将不胜感激。如果您需要我提供更多信息,请告诉我。

【问题讨论】:

【参考方案1】:

我今天遇到了类似的事情,并尝试对此进行更多了解。首先尝试删除 Heroku。然后在终端输入 sudo su 进入你的根目录,输入密码,检查 npm 的版本。然后检查heroku --version。如果没有弹出直接下载 npm install -g heroku。检查版本,然后打开一个新终端并检查 heroku --version。它应该在这一点上工作。希望这能为您指明正确的方向。

【讨论】:

以上是关于安装“npm install -g heroku”时出现 npm 调试升级问题的主要内容,如果未能解决你的问题,请参考以下文章

MySQL免安装版与安装版区别

下载完安装包怎么安装

分清全局安装与本地安装

安装一个软件提示,该安装包未包含任何证书,安装失败,怎么解决

把两个安装文件做成一个安装包,怎么做

myeclipse怎么安装怎样安装myeclipse