I've updgraded an old version of Node Red to version v2.1.1
All nodes seem to be working except the Change node does not give the option for using the different context stores.
When Node Red starts, it also does not show which it will use as the Default store (it does use the correct store though).
When I used the bash script to upgrade Node Red, I specified the option --node14.
When I try to upgrade again without that option, I get the message "npm does not support Node.js v10.24.1"
How do I get Node.js upgraded permanently?
Could this be the problem with the Change node?
Not sure what is happening now. I tried upgrading again (using the --node16 option). The upgraded Node Red version is v2.1.3 and the Change node shows the correct options (the startup still doesn't show which is the Default store).
I then tried the upgrade again but without the --node16 option and the upgrade failed with the message "npm does not support Node.js v10.24.1".
So my first question still stands (how to get the Node.js upgrade to stay), but the Change node issue may be resolved.
Show us the full startup log, rather than just a portion of it. Copy/paste the log please rather than screenshot. Use the </> button when pasting the log here.
What do these commands show?
node -v
npm -v
which node
which npm
apt-cache policy nodejs
//contextStorage: {
// default: {
// module:"localfilesystem"
// },
//},
contextStorage: {
default: "file",
file: { module: 'localfilesystem', config: { cache:true , flushInterval: 3600} },
memoryOnly: { module: 'memory' }
},
// The following property can be used to order the categories in the editor
Oct 29 17:22:39 RPi3FT Node-RED[389]: 29 Oct 17:22:39 - [info] Context store : 'default' [module=localfilesystem]
Oct 29 17:22:39 RPi3FT Node-RED[389]: 29 Oct 17:22:39 - [info] Context store : 'memoryOnly' [module=memory]
Oct 29 17:22:39 RPi3FT Node-RED[389]: 29 Oct 17:22:39 - [info] User directory : /home/pi/.node-red
Any thoughts on how to make the Node.js version keep from going back to v10.24.1 when I upgrade without the option --node16?
Or (to paraphrase Steve Jobs) should I just use the --node16 option each time...
The advantage with this format, is that when selecting a store, it will display both 'memoryOnly' & 'file' as options to select, so it's easy to select the correct store.
However, if you look closely at your context settings which you pasted above@Glake01 , you missed a comma after a brace, which may of being causing your problem. ie memoryOnly: { module: 'memory' } instead of memoryOnly: { module: 'memory' },
@Paul-Reed - Paul, I like that! Where did you discover that? It's not in the Context Store API documentation (that I see) and it is not shown in the settings.js when it is built. (I just started NR v2.1.3 with no strings.js so it would create it and I could check)
Node -v outputs v16.13.0 after I've updated with the --node16 option
Node -voutputs -bash: /usr/local/bin/node: No such file or directory after I try to update without the --node16 option. Also some of my nodes stop working:
30 Oct 10:29:38 - [info] Waiting for missing types to be registered:
30 Oct 10:29:38 - [info] - serial-port (provided by npm module node-red-node-serialport)
30 Oct 10:29:38 - [info] - serial out (provided by npm module node-red-node-serialport)
30 Oct 10:29:38 - [info] - serial in (provided by npm module node-red-node-serialport)
30 Oct 10:29:38 - [info] To install any of these missing modules, run:
30 Oct 10:29:38 - [info] npm install <module name>
30 Oct 10:29:38 - [info] in the directory:
30 Oct 10:29:38 - [info] /home/pi/.node-red
This what the log shows for an upgrade without the --node16 option:
Started : Sat Oct 30 10:27:13 MDT 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.
Reading package lists...
Building dependency tree...
Reading state information...
Package 'nodered' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Versions: node:v10.24.1 npm:8.1.1
Now install Node-RED
npm WARN npm npm does not support Node.js v10.24.1
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm You can find the latest version at https://nodejs.org/
npm WARN EBADENGINE Unsupported engine { package: 'node-red@2.1.3',
npm WARN EBADENGINE required: { node: '>=12' },
npm WARN EBADENGINE current: { node: 'v10.24.1', npm: '8.1.1' } }
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: '8.1.1' } }
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: '8.1.1' } }
added 290 packages in 49s
2.1.3
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-audio@late$
npm WARN npm npm does not support Node.js v10.24.1
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm You can find the latest version at https://nodejs.org/
npm WARN EBADENGINE Unsupported engine { package: 'node-red-dashboard@3.1.0',
npm WARN EBADENGINE required: { node: '>=12' },
npm WARN EBADENGINE current: { node: 'v10.24.1', npm: '8.1.1' } }
npm WARN EBADENGINE Unsupported engine { package: 'node-red-node-sqlite@1.0.1',
npm WARN EBADENGINE required: { node: '>=12' },
npm WARN EBADENGINE current: { node: 'v10.24.1', npm: '8.1.1' } }
up to date in 9s
Now add the shortcut and start/stop/log scripts to the menu
Now add systemd script and configure it for pi
ln: failed to create symbolic link '/usr/bin/python': File exists
Now add launcher to top bar, add cpu temp example, make sure ping works
The user `pi' is already a member of `gpio'.
Memory : 1.0G
Started : Sat Oct 30 10:27:13 MDT 2021
Finished: Sat Oct 30 10:28:40 MDT 2021
Already have nodejs v10.24.1
OLD nodejs 10 :
NEW nodejs 16 :
Installing nodejs 16 over 10 .
Thank you all for your help!
The context store is working just fine.
I still get the following when I've upgraded node red using the --node16 option so I'll do some Linux Googling to see if I can figure out how to replace v10 with v16 permanently.
That says that /usr/local/bin/node is node v16.13.0. I think that this is where the script installs node, which is not where the package manager apt would install it.
That says that version 10.24.1 has been installed using apt. So you have two versions installed. I don't know whether possibly you installed that after running the script (by running apt install nodejs or similar) or whether the script did not uninstall it for some reason.
The solution, probably, is to uninstall that version sudo apt remove nodejs
then try running the script again. I don't know whether you will need the node16 flag or not.
@dceejay I don't know whether you want to look at this and see whether it indicates a deficiency in the script.