简体   繁体   中英

Error when installing npm in ubuntu 18.04

I have installed node.js and when trying to install npm I get this error.

 (base) yovel@the-beastpad:~$ 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. (base) yovel@the-beastpad:~$

Try

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

You Must try this

first update apt with

sudo apt update

then

sudo apt install npm 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM