Ubuntu 18.04安装npm 报错npm : Depends: node-gyp (>= 0.10.9) but it is not going to be installed

现象:Ubuntu 18.04安装npm 报错npm : Depends: node-gyp (>= 0.10.9) but it is not going to be installed
Ubuntu 18.04安装npm 报错npm : Depends: node-gyp (>= 0.10.9) but it is not going to be installed_第1张图片
解决办法:
Ubuntu Server 18.04 Node.js and npm install

sudo apt remove --purge nodejs npm
sudo apt clean
sudo apt autoclean
sudo apt install -f
sudo apt autoremove

sudo apt install curl
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
sudo apt-get update && sudo apt-get install yarn

npm -version
6.1.0
nodejs -v
v10.7.0

你可能感兴趣的:(ubuntu)