Tuesday, May 7, 2024
 Popular · Latest · Hot · Upcoming
22
rated 0 times [  22] [ 0]  / answers: 1 / hits: 32742  / 1 Year ago, tue, december 6, 2022, 8:59:26

npm does not support Node.js v10.19.0
You should probably upgrade to a newer version of node as we
can't make any promises that npm will work with this version.
You can find the latest version at https://nodejs.org/


More From » apt

 Answers
7

Short Answer


The simplest is to update to Node.js v14:


curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs

If you having problems installing try sudo apt-get purge nodejs, see details.


Long Answer


You could update to newer Node.js-versions, see:
https://github.com/nodesource/distributions#readme
however according to a comment on github, jumping to the newest version, might lead to breaking changes. (I don't notice any.)


Thanks to a comment from @SaidbakR below : To see which version is compatible check the following table:




| NodeJS  | `npm --version` |
|---------|-----------------|
| Node 18 | 8.0+ |
| Node 16 | 6.0+ |
| Node 14 | 4.14+ |
| Node 12 | 4.12+, <8.0 |
| Node 10 | 4.9+, <6.0 |



I skipped the uneven numbers, because they don't have a long-term-support.


If you would like to update to e.g. Node.js 18, edit the number from the code above:


curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
if [ -f "/etc/debian_version" ]; then
sudo apt-get install -y nodejs
fi

This answer is based on (How to update node.js) as well on (compatible node.js and npm-Versions)


[#928] Thursday, December 8, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
peafowkes

Total Points: 356
Total Questions: 102
Total Answers: 117

Location: Lebanon
Member since Tue, Oct 12, 2021
3 Years ago
;