It’s an attempt to check that the web socket is actually an upgrade of an existing connection and not a direct ws request in order to grab data and possibly inject control.
Last couple of times I've tried to upgrade Dashboard I get the following errors (log):
-----------------------------------------------------------
2020-07-11T12:55:12.256Z Install : node-red-dashboard 2.23.0
2020-07-11T12:55:13.452Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix="~" --production node-red-dashboard@2.23.0
2020-07-11T12:55:48.487Z [err] npm WARN checkPermissions Missing write access to /home/pi/.node-red/node_modules/node-red-contrib-example-lower-case
2020-07-11T12:55:50.990Z [err] npm
2020-07-11T12:55:50.992Z [err] npm WARN .node-red No description
2020-07-11T12:55:50.992Z [err] npm WARN .node-red No repository field.
2020-07-11T12:55:50.992Z [err] npm WARN .node-red No README data
2020-07-11T12:55:50.992Z [err] npm WARN .node-red No license field.
2020-07-11T12:55:50.998Z [err]
2020-07-11T12:55:51.027Z [err] npm
2020-07-11T12:55:51.029Z [err] ERR! code ENOENT
2020-07-11T12:55:51.029Z [err] npm ERR! syscall access
2020-07-11T12:55:51.029Z [err] npm ERR!
2020-07-11T12:55:51.030Z [err] path /home/pi/.node-red/node_modules/node-red-contrib-example-lower-case
2020-07-11T12:55:51.030Z [err] npm ERR! errno -2
2020-07-11T12:55:51.030Z [err] npm ERR! enoent ENOENT: no such file or directory, access '/home/pi/.node-red/node_modules/node-red-contrib-example-lower-case'
2020-07-11T12:55:51.030Z [err] npm ERR!
2020-07-11T12:55:51.033Z [err] enoent This is related to npm not being able to find a file.
2020-07-11T12:55:51.033Z [err] npm ERR! enoent
2020-07-11T12:55:51.201Z [err]
2020-07-11T12:55:51.202Z [err] npm ERR! A complete log of this run can be found in:
2020-07-11T12:55:51.202Z [err] npm ERR! /home/pi/.npm/_logs/2020-07-11T12_55_51_052Z-debug.log
2020-07-11T12:55:51.228Z rc=254
I have never installed and do not now have a node named node-red-contrib-example-lower-case . There is almost no mention oif this node on the internet or github. This problem is affecting any node upgrade I attempt.
Does that node appear in your package.json? If not then also look in package-lock.json.
If it does appear in package.json then delete that entry (watch the commas) and try again.
That keeps information about which versions of nodes are currently installed. So unless you have a requirement to keep a particular version of something installed then yes. I think it most unlikely that this file is involved in this problem though. I just wanted the op to check there if the node is not referenced in package.lock.
I've had lots of issues with it so I regularly delete it. npm rebuilds it as needed anyway. I think that it is more to do with being able to replicate your installation with a fixed set of package versions. Something that is less likely to be required with Node-RED installations.
Thanks Colin,
I did find it in both files (no idea why), deleted in both, then stop-start NR. But the same ERR is still showing about that node when I try to upgrade (which still fails). Is there somewhere else I could check?
Make sure it has not come back to package.json, delete the lock file, then from your .node-red folder run npm install
and post the result here if there are any errors.
Tried that zenofmud, no joy, however, I did a search for anything related to "lower" and found in the node_modules directory (at the very bottom of the quite long directory listing) a broken link named node-red-contrib-example-lower-case. I deleted that link and all is working properly now.
Thanks to each of you for your help, you gave me ideas that kept me trying things to correct this. I'd given up a couple of times before. I now have the latest Dashboard (thanks dceejay).
Ah, so it was a link to a non-existent folder. I guess at some point someone using the machine followed the Create you first node example and when finished, instead of uninstalling the node just deleted the folder. npm maybe looks in there even when uninstalling it, and fails because the link is broken. That is worth remembering for the future.
In case you didn't realise, this was nothing to do with the dashboard, any npm action would have failed similarly. Presumably this is the first time you have used npm since the folder went AWOL.