Command ‘npm‘ not found, but can be installed with:sudo apt install npm 解决方案

问题描述

今天在执行

npm install -g npx

报错

Command 'npm' not found, but can be installed with:

sudo apt install npm

解决方案

sudo apt-get remove npm
sudo apt-get remove nodejs-legacy
sudo apt-get remove nodejs
sudo rm /usr/bin/node
sudo apt-get install nodejs
sudo apt-get install nodejs-legacy
sudo apt-get install npm.

参考链接

npm: command not found解决方案(已解决) - 知乎

你可能感兴趣的:(bug解决方案,ubuntu,npm,node.js,ubuntu)