Hi.
i was just upgrading node-red to the latest 1.2.9 (from .1.2.7) and ran the NPM command to do the update.
npm up -g --unsafe-perm node-red
but before it would do it NPM reported there was a minor update to do first and run this first
npm install -g npm@7.5.2
after doing that… if it then ran any NPM command it would now say NPM not found.
so i thought maybe somehow it has remove it self so did
apt-get install -y npm
but that now is just worse as it think it v5.8.0 and now it just crashes
Error: Cannot find module 'semver'
Require stack:
- /usr/share/npm/lib/utils/unsupported.js
- /usr/share/npm/bin/npm-cli.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:925:15)
at Function.Module._load (node:internal/modules/cjs/loader:769:27)
at Module.require (node:internal/modules/cjs/loader:997:19)
at require (node:internal/modules/cjs/helpers:92:18)
at Object.<anonymous> (/usr/share/npm/lib/utils/unsupported.js:2:14)
at Module._compile (node:internal/modules/cjs/loader:1108:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
at Module.load (node:internal/modules/cjs/loader:973:32)
at Function.Module._load (node:internal/modules/cjs/loader:813:14)
at Module.require (node:internal/modules/cjs/loader:997:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/usr/share/npm/lib/utils/unsupported.js',
'/usr/share/npm/bin/npm-cli.js'
]
node -v brings back v15.5.0 and Node-Red is running ok. but what have i now gone and messed up
as means i wont be able to use NPM .
thanks.