解决在ubuntu上安装npm所发生的报错问题

sudo apt install npm

安装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
点赞

发表评论

电子邮件地址不会被公开,只有你知道( ̄▽ ̄)"