I am trying to install npm on Ubuntu. First I check NPM is not installed:
jmlopez@desarrollo:/usr/share$ npm -v
Command 'npm' not found, but can be installed with:
sudo apt install npm
Then I try to install it but I get:
jmlopez@desarrollo:/usr/share$ sudo apt install npm
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
npm is already the newest version (8.5.1~ds-1).
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
libnode-dev : Depends: libssl-dev but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
I tried to uninstall nodejs as well, but it throws this:
jmlopez@desarrollo:/usr/share$ sudo apt remove nodejs
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
libnode-dev : Depends: libssl-dev but it is not going to be installed
node-abab : Depends: nodejs but it is not going to be installed
node-aproba : Depends: nodejs but it is not going to be installed
node-archy : Depends: nodejs but it is not going to be installed
node-argparse : Depends: nodejs but it is not going to be installed
node-cacache : Depends: nodejs but it is not going to be installed
node-chalk : Depends: nodejs but it is not going to be installed
node-clone : Depends: nodejs but it is not going to be installed
node-colors : Depends: nodejs but it is not going to be installed
node-combined-stream : Depends: nodejs but it is not going to be installed
node-console-control-strings : Depends: nodejs but it is not going to be installed
node-coveralls : Depends: nodejs:any
node-cssom : Depends: nodejs but it is not going to be installed
node-debug : Depends: nodejs but it is not going to be installed
node-esprima : Depends: nodejs:any
node-events : Depends: nodejs but it is not going to be installed
node-graceful-fs : Depends: nodejs but it is not going to be installed
node-gyp : Depends: nodejs:any
node-js-yaml : Depends: nodejs:any
node-json-buffer : Depends: nodejs but it is not going to be installed
node-lcov-parse : Depends: nodejs but it is not going to be installed
node-log-driver : Depends: nodejs (>= 10) but it is not going to be installed
node-mime : Depends: nodejs:any
node-mkdirp : Depends: nodejs:any
node-ms : Depends: nodejs but it is not going to be installed
node-nopt : Depends: nodejs:any
node-normalize-package-data : Depends: nodejs but it is not going to be installed
node-object-assign : Depends: nodejs but it is not going to be installed
node-opener : Depends: nodejs:any
node-psl : Depends: nodejs but it is not going to be installed
node-punycode : Depends: nodejs but it is not going to be installed
node-read-package-json : Depends: nodejs but it is not going to be installed
node-rimraf : Depends: nodejs but it is not going to be installed
node-semver : Depends: nodejs (>= 10) but it is not going to be installed
node-source-map-support : Depends: nodejs but it is not going to be installed
node-ssri : Depends: nodejs but it is not going to be installed
node-stack-utils : Depends: nodejs but it is not going to be installed
node-strip-ansi : Depends: nodejs but it is not going to be installed
node-tap : Depends: nodejs but it is not going to be installed
node-tap-mocha-reporter : Depends: nodejs:any
node-tap-parser : Depends: nodejs:any
node-unique-filename : Depends: nodejs but it is not going to be installed
node-which : Depends: nodejs:any
node-write-file-atomic : Depends: nodejs but it is not going to be installed
node-ws : Depends: nodejs:any
npm : Depends: nodejs:any (>= 10)
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
The installed version of nodejs is:
jmlopez@desarrollo:/usr/share$ nodejs -v
v12.22.9
Could these problems be related? Any ideas to fix them?
Thank you very much in advance!!