node.js - 错误 : npm is known not to run on Node. js V4.2.6

标签 node.js npm

如何解决以下错误?我使用 Ubuntu 16。 当我运行任何 npm 命令(例如“npm run dev”)时,我会收到此错误:

ERROR: npm is known not to run on Node.js v4.2.6 Node.js 4 is supported but the specific version you're running has a bug known to break npm. Please update to at least ${rel.min} to use this version of npm. You can find the latest release of Node.js at https://nodejs.org/

最佳答案

首先,完全卸载 nodejs 和 npm。

sudo apt remove nodejs npm

然后,通过以下链接重新安装它:

curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs

引用:https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions

关于node.js - 错误 : npm is known not to run on Node. js V4.2.6,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46360567/

相关文章:

javascript - 如何在WebView中打开开发人员工具

javascript - 使用 Node 提供 Vue 应用程序时,构建会导致空 HTML 页面出现语法错误

javascript - 如何检查本地 JavaScript 包是否是 Semver?

javascript - grunt 问题 - 警告 : Task "ngAnnotate:dist" failed. 使用 --force 继续

node.js - 为什么 npm 的名字不是 Node Package Manager?

node.js - 错误 : The default Firebase app already exists. 真的吗?

javascript - 如何部署nodejs、angularjs和apache

node.js - 列出没有 devDependencies 的 Node 包依赖项

javascript - Angular 6 : Npm ERR! 缺少脚本:部署到 heroku 时启动

node.js - Mac OS X Mavericks 更新后,使用 npm 进行全局安装不起作用