Debian Arm64 - nodejs/npm dependencies held back


#1

I’m trying to upgrade nodejs and npm. Apparently, the nodejs package is being held back at 4.8.2 which is ancient and not compatible with many of the software tools. Is there any effort in upgrading these packages?

The following packages have unmet dependencies:
npm : Depends: nodejs (>= 6.11~) but 4.8.2~dfsg-1 is to be installed
Depends: node-abbrev (>= 1.1.1~) but 1.0.9-1 is to be installed
Depends: node-ansi-regex (>= 3.0~) but 2.0.0-1 is to be installed
Depends: node-cacache (>= 10.0.4~) but it is not going to be installed
Depends: node-config-chain (>= 1.1.11~) but it is not going to be installed
Depends: node-glob (>= 7.1.2~) but 7.1.1-1 is to be installed
Depends: node-hosted-git-info (>= 2.6~) but 2.1.5-1 is to be installed
Depends: node-ini (>= 1.3.5~) but 1.1.0-1 is to be installed
Depends: node-npm-package-arg but it is not going to be installed
Depends: node-jsonstream (>= 1.3.2~) but 1.0.3-4 is to be installed
Depends: node-libnpx (>= 10.0.1~) but it is not going to be installed
Depends: node-lockfile (>= 1.0.3~) but 0.4.1-1 is to be installed
Depends: node-lru-cache (>= 4.1.1~) but 4.0.2-1 is to be installed
Depends: node-mississippi (>= 3.0~) but it is not going to be installed
Depends: node-move-concurrently (>= 1.0.1~) but it is not going to be installed
Depends: node-normalize-package-data (>= 2.4~) but 2.3.5-2 is to be installed
Depends: node-gyp (>= 3.6.2~) but 3.4.0-1 is to be installed
Depends: node-resolve-from (>= 4.0~) but 2.0.0-1 is to be installed
Depends: node-npmlog (>= 4.1.2~) but 0.0.4-1 is to be installed
Depends: node-osenv (>= 0.1.5~) but 0.1.0-1 is to be installed
Depends: node-read-package-json (>= 2.0.13~) but 1.2.4-1 is to be installed
Depends: node-request (>= 2.83~) but 2.26.1-1 is to be installed
Depends: node-retry (>= 0.10.1~) but 0.6.0-1 is to be installed
Depends: node-rimraf (>= 2.6.2~) but 2.5.4-2 is to be installed
Depends: node-semver (>= 5.5~) but 5.3.0-1 is to be installed
Depends: node-sha (>= 2.0.1~) but 1.2.3-1 is to be installed
Depends: node-slide (>= 1.1.6~) but 1.1.4-1 is to be installed
Depends: node-strip-ansi (>= 4.0~) but 3.0.1-1 is to be installed
Depends: node-tar (>= 4.4~) but 2.2.1-1 is to be installed
Depends: node-boxen (>= 1.2.1~) but it is not going to be installed
Depends: node-latest-version (>= 3.0~) but it is not going to be installed
Depends: node-which (>= 1.3~) but 1.2.11-1 is to be installed
E: Unable to correct problems, you have held broken packages.


#2

I may have found my own solution by using NVM.

https://linuxize.com/post/how-to-install-node-js-on-debian-9/

linaro@linaro-alip:~$ nvm ls
-> v6.14.3
v10.15.3
v12.0.0
default -> node (-> v12.0.0)
node -> stable (-> v12.0.0) (default)
stable -> 12.0 (-> v12.0.0) (default)
iojs -> N/A (default)
lts/* -> lts/dubnium (-> v10.15.3)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.16.0 (-> N/A)
lts/dubnium -> v10.15.3


#3

Since nodejs has its own release channel, I’d say don’t depend on Linux distro for all nodejs/npm stuff. I just downloaded the zip file from nodejs.org, and unzip them into /usr and that’s it

$ nodejs -v
v10.15.3

The only drawback is no package record so apt doesn’t know you have newer nodejs, you may update it manually.

The github repo posted by @smlikens is the best way to install nodejs.


#5

Try this repo you may find better luck https://github.com/nodesource/distributions/blob/master/README.md


#6

NVM is definitely the way to go on this. I can test the new versions of node and NPM as they come out and roll back effortlessly if there is an issue.