0
votes

I've updated to the new Ubuntu 20.04LTS version and all my node installations have gone. So to install node I have tried the following 2 methods:

1.sudo apt update

sudo apt install nodejs npm

  1. curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -

sudo apt install nodejs

While installing nodejs I'm getting the error : nodejs : Depends: python2-minimal but it is not installable . Unable to correct problems, you have held broken packages.

screenshot

2

2 Answers

0
votes

You need to install python2. Steps in Ubuntu 20

  1. sudo add-apt-repository universe
  2. sudo apt-get update
  3. sudo apt-get install python2 This will install python2 successfully. Now you can continue with normal nodejs installation
0
votes

I had a similar problem and solved it by following the instructions on https://speedysense.com/install-nodejs-on-ubuntu-20-04/

Tldr run these on a terminal: for current LTS Release (v14.x),

curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -

sudo apt-get install -y nodejs

Afterwards check your Nodejs and npm version by running these on a terminal:

node --version
npm --version