Updating npm and node.js with alternate-node-red-installer

Last year i built a unbuntu server and installed node-red with alternate-node-red-installer(GitHub - TotallyInformation/alternate-node-red-installer: An alternative installer for Node-RED. Avoids global installs, no admin rights required.) wich runs perfect.

Now i want to add another install so i started with sudo npm install -g alternate-node-red-installer

and this is the ouput:

/usr/local/bin/alternate-node-red-installer -> /usr/local/lib/node_modules/alter                                                  nate-node-red-installer/bin/install-node-red.js
/usr/local/bin/nrinstall -> /usr/local/lib/node_modules/alternate-node-red-insta                                                  ller/bin/install-node-red.js
npm WARN notsup Unsupported engine for yargs@17.4.1: wanted: {"node":">=12"} (cu                                                  rrent: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: yargs@17.4.1
npm WARN notsup Unsupported engine for yargs-parser@21.0.1: wanted: {"node":">=1                                                  2"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: yargs-parser@21.0.                                                  1

+ alternate-node-red-installer@2.0.3
added 3 packages from 3 contributors, removed 11 packages and updated 21 package                                                  s in 5.407s


   ╭───────────────────────────────────────────────────────────────╮
   │                                                               │
   │      New major version of npm available! 6.14.4 → 7.7.5       │
   │   Changelog: https://github.com/npm/cli/releases/tag/v7.7.5   │
   │               Run npm install -g npm to update!               │
   │                                                               │
   ╰───────────────────────────────────────────────────────────────╯

So i checked one of my installs :

node --version && npm --version

v10.19.0
6.14.4
 npm run check-master
> node-red-master@1.0.0 check-master /home/wasabi/ndip
> npm outdated

Package         Current  Wanted  Latest  Location
node-red          1.2.9   2.2.2   2.2.2  node-red-master
node-red-admin    0.2.7   3.0.0   3.0.0  node-red-master
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-red-master@1.0.0 check-master: `npm outdated`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-red-master@1.0.0 check-master script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/wasabi/.npm/_logs/2022-05-01T14_59_08_823Z-debug.log


So i tried npm update with another install

npm ERR! code EINTEGRITY
npm ERR! sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== integrity checksum failed when using sha512: wanted sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== but got sha512-z4PhNX7vuL3xVChQ1m2AB9Yg5AULVxXcg/SpIdNs6c5H0NE8XYXysP+DGNKHfuwvY7kxvUdBeoGlODJ6+SfaPg==. (0 bytes)

> bcrypt@5.0.1 install /home/wasabi/bioservice/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build

[bcrypt] Success: "/home/wasabi/bioservice/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node" is installed via remote
npm WARN notsup Unsupported engine for node-red-admin@3.0.0: wanted: {"node":">=14"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: node-red-admin@3.0.0
npm WARN notsup Unsupported engine for node-red@2.2.2: wanted: {"node":">=12"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: node-red@2.2.2
npm WARN notsup Unsupported engine for node-red-admin@2.2.4: wanted: {"node":">=12"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: node-red-admin@2.2.4
npm WARN notsup Unsupported engine for fs-extra@10.0.0: wanted: {"node":">=12"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: fs-extra@10.0.0
npm WARN notsup Unsupported engine for compress-brotli@1.3.6: wanted: {"node":">= 12"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: compress-brotli@1.3.6
npm WARN node-red-master@1.0.0 No repository field.

+ node-red-admin@3.0.0
+ node-red@2.2.2
added 63 packages from 158 contributors, removed 130 packages, updated 109 packages, moved 1 package and audited 295 packages in 13.737s

27 packages are looking for funding
  run `npm fund` for details

found 1 high severity vulnerability
  run `npm audit fix` to fix them, or `npm audit` for details
npm ERR! Callback called more than once.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/wasabi/.npm/_logs/2022-05-01T15_07_00_197Z-debug.log

Clearly i have to update npm and node.js.

Now the question is HOW do do it safely and not break everything?

Is npm and node.js are installed globally in this type of install?

Thanks for your input.

Hi, node v10 has not been in service for some time. Indeed node v12 is just about to drop out of support as well.

Node-RED itself requires node v12 or above.

Releases | Node.js (nodejs.org)

To upgrade safely. Follow the instructions on upgrading node.js from the node.js website. Personally, I use the Debian repo so that updates and upgrades are easy.

Then in your master folder (where you've installed node-red), run npm rebuild and then do the same in the data folder. If you are using uibuilder v5, run the same command again in your uibRoot folder.

Then you should be good to go.

that was it, thanks Julian.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.