发布于 1年前

解决npm运行错误:npm is known not to run on Node.js v4.2.6

在Ubuntu16运行npm命令报下面的错误:

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/

解决方法

尝试重新安装npm

卸载

sudo apt remove nodejs npm

重新安装 Node 6

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

或者重新安装Node 8

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
©2020 edoou.com   京ICP备16001874号-3