sudo apt install npm

执行上面的安装命令,会报错:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 npm : Depends: node-gyp (>= 0.10.9) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

执行如下命令能解决上面的问题:

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。
sudo apt-get install nodejs-dev node-gyp libssl1.0-dev

再次执行npm安装命令即可。

 

完。

 

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄