Error npm and node Ubuntu

1

I have had many problems installing npm and node in ubuntu, I now have the following error:

    npm : Depende: nodejs mas não será instalado

    mais um monte de dependências...

    E: Impossível corrigir problemas, você manteve (hold) pacotes quebrados.

Does anyone know?

    
asked by anonymous 27.06.2017 / 16:46

2 answers

1

Make sure you can fix the broken packages:

sudo apt-get install -f

If he gives you the possible options to fix the packages, you can proceed. It may be that the installation of the nodejs package has failed.

If you still find strange behavior, it is recommended that you uninstall npm and reinstall it already with the nodejs package as well.

sudo apt-get remove npm nodejs
sudo apt-get install npm nodejs
    
27.06.2017 / 17:16
0

The sequence of commands above did not work for me, to solve the problem I followed the steps below, if it happens with someone.

Missing dependencies and broken packages that prevented you from installing a program can resolve I managed to solve by giving a:

sudo aptitude safe-upgrade

sudo aptitude update

sudo aptitude install pacote

It tries a workaround when it finds broken packages while apt-get did not!

    
03.01.2019 / 09:30