Building a nodejs Toradex IDE package on Ubuntu 22.04 build machine:
Checking dependencies ...
π openssh-client debian package dependency installed
π sshpass debian package dependency installed
π nodejs debian package dependency installed
π΅ npm debian package dependency not installed
Try to install the missing debian packages and execute the missing installation scripts? <y/N>: y
[sudo] password for workuser:
Hit:1 https://download.docker.com/linux/ubuntu jammy InRelease
Hit:2 https://deb.nodesource.com/node_22.x nodistro InRelease
Hit:3 https://packages.microsoft.com/ubuntu/22.04/prod jammy InRelease
Hit:4 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:5 http://archive.ubuntu.com/ubuntu jammy InRelease
Hit:6 https://dl.google.com/linux/chrome/deb stable InRelease
Hit:7 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:8 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Reading package lists... Done
W: https://packages.microsoft.com/ubuntu/22.04/prod/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
Reading package lists... Done
Building dependency tree... Done
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-agent-base but it is not going to be installed
Depends: node-aproba but it is not going to be installed
Depends: node-archy but it is not going to be installed
Depends: node-cacache but it is not going to be installed
Depends: node-chalk but it is not going to be installed
Depends: node-cli-table3
Depends: node-colors but it is not going to be installed
Depends: node-columnify but it is not going to be installed
Depends: node-debug but it is not going to be installed
Depends: node-emoji-regex
Depends: node-got but it is not going to be installed
Depends: node-graceful-fs but it is not going to be installed
Depends: node-gyp but it is not going to be installed
Depends: node-https-proxy-agent but it is not going to be installed
Depends: node-mkdirp but it is not going to be installed
Depends: node-ms but it is not going to be installed
Depends: node-nopt but it is not going to be installed
Depends: node-normalize-package-data but it is not going to be installed
Depends: node-npm-package-arg but it is not going to be installed
Depends: node-npmlog but it is not going to be installed
Depends: node-read-package-json but it is not going to be installed
Depends: node-rimraf but it is not going to be installed
Depends: node-semver but it is not going to be installed
Depends: node-ssri but it is not going to be installed
Depends: node-string-width but it is not going to be installed
Depends: node-strip-ansi but it is not going to be installed
Depends: node-tar but it is not going to be installed
Depends: node-validate-npm-package-name but it is not going to be installed
Depends: node-which but it is not going to be installed
Depends: node-write-file-atomic but it is not going to be installed
Depends: nodejs:any (>= 10)
Recommends: node-tap but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
β error trying to install package npm
* The terminal process "pwsh '-nop', '/home/workuser/workspace/qedge/qedgesio/.conf/checkDeps.ps1'" terminated with exit code: 69.
But node and npm are there:
workuser@toradex:~/workspace/testproject/testprojectsio$ node -v
v22.8.0
workuser@toradex:~/workspace/testproject/testprojectsio$ npm -v
10.8.2
In fact sudo apt-get list
show only nodejs, not npm, but this is something that happens in latest nodejs versions (in my case, 22.8):
$ apt list --installed | grep node
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
nodejs/nodistro,now 22.8.0-1nodesource1 amd64 [installed]
$ apt list --installed | grep npm
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
How can we have that fixed? I cannot work with nodejs that comes with Ubuntu (12.x), as my code need newer versions.
This is how Iβve installed node (to get 22.x version):
curl -sL https://deb.nodesource.com/setup_22.x -o /tmp/nodesource_setup.sh
sudo bash /tmp/nodesource_setup.sh
sudo apt-get install nodejs -y
Iβve tried to install npm only:
sudo apt-get install npm
Reading package lists... Done
Building dependency tree... Done
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-agent-base but it is not going to be installed
Depends: node-aproba but it is not going to be installed
Depends: node-archy but it is not going to be installed
Depends: node-cacache but it is not going to be installed
Depends: node-chalk but it is not going to be installed
Depends: node-cli-table3
Depends: node-colors but it is not going to be installed
Depends: node-columnify but it is not going to be installed
Depends: node-debug but it is not going to be installed
Depends: node-emoji-regex
Depends: node-got but it is not going to be installed
Depends: node-graceful-fs but it is not going to be installed
Depends: node-gyp but it is not going to be installed
Depends: node-https-proxy-agent but it is not going to be installed
Depends: node-mkdirp but it is not going to be installed
Depends: node-ms but it is not going to be installed
Depends: node-nopt but it is not going to be installed
Depends: node-normalize-package-data but it is not going to be installed
Depends: node-npm-package-arg but it is not going to be installed
Depends: node-npmlog but it is not going to be installed
Depends: node-read-package-json but it is not going to be installed
Depends: node-rimraf but it is not going to be installed
Depends: node-semver but it is not going to be installed
Depends: node-ssri but it is not going to be installed
Depends: node-string-width but it is not going to be installed
Depends: node-strip-ansi but it is not going to be installed
Depends: node-tar but it is not going to be installed
Depends: node-validate-npm-package-name but it is not going to be installed
Depends: node-which but it is not going to be installed
Depends: node-write-file-atomic but it is not going to be installed
Depends: nodejs:any (>= 10)
Recommends: node-tap but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Naturally canβt as node is already installed using curl.
Thanks for helping.