在ubuntu上安装npm

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.

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

sudo apt-get install nodejs-dev node-gyp libssl1.0-dev

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

 

完。

 

posted @ 2019-04-19 16:05  liyou  阅读(33863)  评论(2编辑  收藏  举报