-
-
Notifications
You must be signed in to change notification settings - Fork 495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Node-red reinstall issue #7128
Comments
Can you show the content of the log file: cat /mnt/dietpi_userdata/node-red/.npm/_logs/2024-06-25T11_23_57_442Z-debug-0.log |
Sure, here you go: ~ ❯ cat /mnt/dietpi_userdata/node-red/.npm/_logs/2024-06-25T11_23_57_442Z-debug-0.log
0 verbose cli /usr/local/bin/node /usr/local/bin/npm
1 info using npm@10.8.1
2 info using node@v22.3.0
3 silly config load:file:/usr/local/lib/node_modules/npm/npmrc
4 silly config load:file:/mnt/dietpi_userdata/node-red/.npmrc
5 silly config load:file:/usr/local/etc/npmrc
6 verbose title npm i node-red
7 verbose argv "i" "--no-audit" "node-red"
8 verbose logfile logs-max:10 dir:/mnt/dietpi_userdata/node-red/.npm/_logs/2024-06-25T11_23_57_442Z-
9 verbose logfile /mnt/dietpi_userdata/node-red/.npm/_logs/2024-06-25T11_23_57_442Z-debug-0.log
10 silly logfile start cleaning logs, removing 2 files
11 verbose stack TypeError: Class extends value undefined is not a constructor or null
11 verbose stack at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/minipass-collect/index.js:4:23)
11 verbose stack at Module._compile (node:internal/modules/cjs/loader:1460:14)
11 verbose stack at Module._extensions..js (node:internal/modules/cjs/loader:1544:10)
11 verbose stack at Module.load (node:internal/modules/cjs/loader:1275:32)
11 verbose stack at Module._load (node:internal/modules/cjs/loader:1091:12)
11 verbose stack at wrapModuleLoad (node:internal/modules/cjs/loader:212:19)
11 verbose stack at Module.require (node:internal/modules/cjs/loader:1297:12)
11 verbose stack at require (node:internal/modules/helpers:123:16)
11 verbose stack at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/cacache/lib/get.js:3:17)
11 verbose stack at Module._compile (node:internal/modules/cjs/loader:1460:14)
12 error Class extends value undefined is not a constructor or null
13 verbose cwd /mnt/dietpi_userdata/node-red
14 verbose os Linux 6.1.21-v7+
15 verbose node v22.3.0
16 verbose npm v10.8.1
17 verbose exit 1
18 verbose code 1
19 error A complete log of this run can be found in: /mnt/dietpi_userdata/node-red/.npm/_logs/2024-06-25T11_23_57_442Z-debug-0.log |
Hmm, Can you test this: cd /mnt/dietpi_userdata/node-red
sudo -u nodered npm i --no-audit node-red@latest And if it does not work, this: cd /mnt/dietpi_userdata/node-red
sudo -u nodered npm up --no-audit node-red The hammer method is to remove all local modules and install them freshly. But if one of the above works, I would prefer it, causing less traffic and disk I/O: cd /mnt/dietpi_userdata/node-red
sudo rm -R node_modules
npm i --no-audit node-red EDIT: Ah, the last one is bad, because it removes all manually installed Node-RED plugins as well. |
Tested the first 2 options: /mnt/dietpi_userdata/node-red ❯ sudo -u nodered npm i --no-audit node-red@latest
npm error Class extends value undefined is not a constructor or null
npm error A complete log of this run can be found in: /mnt/dietpi_userdata/node-red/.npm/_logs/2024-06-25T14_11_26_351Z-debug-0.log
/mnt/dietpi_userdata/node-red ❯ sudo -u nodered npm up --no-audit node-red
npm error Class extends value undefined is not a constructor or null
npm error A complete log of this run can be found in: /mnt/dietpi_userdata/node-red/.npm/_logs/2024-06-25T14_11_59_706Z-debug-0.log Will look into the third option asap. |
Actually, when plugins were installed manually, they should show up in cd /mnt/dietpi_userdata/node-red
sudo rm -R node_modules
sudo -u nodered npm up --no-audit That should install and update all packages defined in |
Yes, exactly what I just did. :-) /mnt/dietpi_userdata/node-red ❯ cat /mnt/dietpi_userdata/node-red/.npm/_logs/2024-06-25T14_22_15_416Z-debug-0.log
0 verbose cli /usr/local/bin/node /usr/local/bin/npm
1 info using npm@10.8.1
2 info using node@v22.3.0
3 silly config load:file:/usr/local/lib/node_modules/npm/npmrc
4 silly config load:file:/mnt/dietpi_userdata/node-red/.npmrc
5 silly config load:file:/usr/local/etc/npmrc
6 verbose title npm i node-red
7 verbose argv "i" "--no-audit" "node-red"
8 verbose logfile logs-max:10 dir:/mnt/dietpi_userdata/node-red/.npm/_logs/2024-06-25T14_22_15_416Z-
9 verbose logfile /mnt/dietpi_userdata/node-red/.npm/_logs/2024-06-25T14_22_15_416Z-debug-0.log
10 silly logfile start cleaning logs, removing 2 files
11 verbose stack TypeError: Class extends value undefined is not a constructor or null
11 verbose stack at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/minipass-collect/index.js:4:23)
11 verbose stack at Module._compile (node:internal/modules/cjs/loader:1460:14)
11 verbose stack at Module._extensions..js (node:internal/modules/cjs/loader:1544:10)
11 verbose stack at Module.load (node:internal/modules/cjs/loader:1275:32)
11 verbose stack at Module._load (node:internal/modules/cjs/loader:1091:12)
11 verbose stack at wrapModuleLoad (node:internal/modules/cjs/loader:212:19)
11 verbose stack at Module.require (node:internal/modules/cjs/loader:1297:12)
11 verbose stack at require (node:internal/modules/helpers:123:16)
11 verbose stack at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/cacache/lib/get.js:3:17)
11 verbose stack at Module._compile (node:internal/modules/cjs/loader:1460:14)
12 error Class extends value undefined is not a constructor or null
13 verbose cwd /mnt/dietpi_userdata/node-red
14 verbose os Linux 6.1.21-v7+
15 verbose node v22.3.0
16 verbose npm v10.8.1
17 verbose exit 1
18 verbose code 1
19 error A complete log of this run can be found in: /mnt/dietpi_userdata/node-red/.npm/_logs/2024-06-25T14_22_15_416Z-debug-0.log |
Hmm, last idea is the cache: sudo rm -R .npm/_cacache
sudo -u nodered npm up --no-audit EDIT: Actually, it seems to be also possibly that only some older globally installed modules break it:
So a general issue when upgrading from Node v14. In this particular case with ... looking further at it: I is actually not the globally installed sudo rm -R /usr/local/lib/node_modules/{corepack,npm}
dietpi-software reinstall 122 EDIT2: I added the |
So after some searching online I found that this is an error that sometimes occurs when using the Node and node-red are now successfully running again, and node-red is on the latest version. I have not lost any data in node-red, so that's a win. Doing this does seem to have broken my pm2 install though, but I was only using pm2 for a single service, so fixing that should be relatively easy. EDIT: pm2 started automatically again after a reboot, and my service is back up and running, so all is well. Happy I got this far and thanks for your help on this! |
- DietPi-Software | Node-RED: Resolved an issue where reinstalls/updates failed because of incompatibilities between latest Node.js or global modules with older local instances. Many thanks to @thinkbig1979 for reporting this issue: #7128 - DietPi-Software | Add "@latest" version tag to all Node module installs, else installed modules won't necessarily be updated - DietPi-Software | Replace sudo calls with "runuser". It is an alternative, which can only be executed as root user, and hence does not imply any authentication system. Shell aliases added for future user calls, however, need to keep using sudo, to support non-root logins.
Ah yeah that makes sense, so the Node version did not match the However, there were as well issues in the past related to incompatible local Node modules/dependencies. So if a reinstall is done, which includes a Node.js update, it makes sense to reinstall all modules from scratch. I also disabled the local cache now: 611c047 Additionally, our Node.js installer does not remove the global |
Hit an error after running
dietpi-software reinstall 122
Muy goal was to upgrade my existing nod-red installation to version 4.0.
All was proceeding well until here:
I used the built in bug report function, and as you can see it created a reference code for the issue.
System info:
Linux DietPi 6.1.21-v7+ #1642 SMP Mon Apr 3 17:20:52 BST 2023 armv7l GNU/Linux
sudo -u nodered npm i --no-audit node-red
The text was updated successfully, but these errors were encountered: