[solved] Install script assumes I still have node v10

The installation script assumes that I still have an Node v10 installed/used.
But in the log it says that I have a newer version.

And yes, I installed nvm in desperation. And now can't get rid of it.
Even with how-to from the net, the script still says I'm using nvm. So I reinstalled it.

Here is my log:

Already have nodejs v14.17.6
OLD nodejs 14 :
NEW nodejs  :

***************************************

Started : Mo 13. Dez 15:35:13 CET 2021
Running for user pi at /home/pi
Found global nodes:   :

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Paketlisten werden gelesen...
Abhängigkeitsbaum wird aufgebaut....
Statusinformationen werden eingelesen....
Paket »nodered« ist nicht installiert, wird also auch nicht entfernt.
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.

Versions: node:v10.24.1 npm:7.23.0
Now install Node-RED
npm WARN EBADENGINE Unsupported engine { package: 'node-red@2.1.4',
npm WARN EBADENGINE   required: { node: '>=12' },
npm WARN EBADENGINE   current: { node: 'v10.24.1', npm: '7.23.0' } }
npm WARN EBADENGINE Unsupported engine { package: 'fs-extra@10.0.0',
npm WARN EBADENGINE   required: { node: '>=12' },
npm WARN EBADENGINE   current: { node: 'v10.24.1', npm: '7.23.0' } }
npm WARN EBADENGINE Unsupported engine { package: 'node-red-admin@2.2.1',
npm WARN EBADENGINE   required: { node: '>=12' },
npm WARN EBADENGINE   current: { node: 'v10.24.1', npm: '7.23.0' } }

added 266 packages in 4m
2.1.4
Now create basic package.json for the user and move any global nodes
Installing extra nodes: node-red-node-pi-gpio@latest node-red-node-random@latest node-red-node-ping@latest node-red-contrib-play$
npm WARN EBADENGINE Unsupported engine { package: 'commander@8.3.0',
npm WARN EBADENGINE   required: { node: '>= 12' },
npm WARN EBADENGINE   current: { node: 'v10.24.1', npm: '7.23.0' } }
npm WARN EBADENGINE Unsupported engine { package: 'luxon@2.2.0',
npm WARN EBADENGINE   required: { node: '>=12' },
npm WARN EBADENGINE   current: { node: 'v10.24.1', npm: '7.23.0' } }
npm WARN EBADENGINE Unsupported engine { package: 'node-red-dashboard@3.1.2',
npm WARN EBADENGINE   required: { node: '>=12' },
npm WARN EBADENGINE   current: { node: 'v10.24.1', npm: '7.23.0' } }

How did you install nvm? If using something like apt, you should be able to remove it the same way.

Afterwards, run whereis node to see where, if anywhere it is located. Try running sudo apt remove node AND sudo apt remove nodejs. Then run whereis node again to see if there is anything remaining.

It is possible that nvm may have left something installed. So always try to remove all installed versions of node before removing nvm. Then never install it again! At least on "live" servers :slight_smile:

After that, you should be able to run the script again.


Personally, I dislike running complex scripts. Dave's is excellent but it often leaves you short of knowledge when things go wrong. Not the script's fault, its just that you haven't learned about each of the components and how they are managed.

But that's just me, I recognise that not everyone has the time, energy or inclination to do that.

Wow, thanks, it's working.

Anyway, I actually did all the steps before that.
Except the point with whereis node, but I didn't get a result from that anyway.
But you gave me another push in towards the (incidential) solution.

I think the key point was to restart the session after removing nvm.

Why that might be, I have too limited of understanding of it, unfortunately. But that was actually the only difference from my previous attempts.

Solution
Remove nvm completly AND restart your session!

To remove nvm:

rm -rf $NVM_DIR ~/.npm ~/.bower

Only starting a new session after this did the trick for me!

Sorry, I thought you'd already done that, that's why I didn't mention it. nvm creates an actual node installation from one or more virtual installs. So it will always leave the last one active.

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