TypeError: Class extends value undefined is not a constructor or null
See original GitHub issueDescribe The Bug:
Using hb-service
to update node to v16.13.0 fails at the rebuilding stage. See below logs. Error also presents itself when then restarting Homebridge each time, but doesn’t actually seem to affect Homebridge functionality. Using the command to downgrade node back to 14.18.1 runs and rebuilds successfully, removing all errors.
To Reproduce:
Running in terminal:
sudo hb-service update-node 16.13.0
Logs
When running the command to update node:
pi@homebridge:~ $ sudo hb-service update-node 16.13.0
ℹ Installing Node.js v16.13.0 over v14.18.1...
ℹ Target: /usr/local
✔ Download complete.
✔ Installed Node.js v16.13.0
ℹ Rebuilding for Node.js v16.13.0...
TypeError: Class extends value undefined is not a constructor or null
at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/socks-proxy-agent/dist/agent.js:114:44)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/socks-proxy-agent/dist/index.js:5:33)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/make-fetch-happen/lib/agent.js:161:25)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
TypeError: Class extends value undefined is not a constructor or null
at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/socks-proxy-agent/dist/agent.js:114:44)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/socks-proxy-agent/dist/index.js:5:33)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/make-fetch-happen/lib/agent.js:161:25)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
Error: Command failed: npm rebuild --unsafe-perm
✖ ERROR: Failed Operation
ℹ Restarting Homebridge Service...
✔ Homebridge Restarted
pi@homebridge:~ $
From then restarting Homebridge each time:
[27/10/2021, 09:34:39] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null
[27/10/2021, 09:34:44] [HB Supervisor] Restarting Homebridge...
[27/10/2021, 09:34:44] [HB Supervisor] Starting Homebridge with extra flags: -I -D
[27/10/2021, 09:34:45] [HB Supervisor] Started Homebridge v1.3.6-beta.1 with PID: 10554
Initializing HAP-NodeJS v0.9.6...
[27/10/2021, 09:34:46] Loaded config.json with 0 accessories and 8 platforms.
[27/10/2021, 09:34:46] Loaded 0 cached accessories from cachedAccessories.
[27/10/2021, 09:34:46] ---
TypeError: Class extends value undefined is not a constructor or null
at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/socks-proxy-agent/dist/agent.js:114:44)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/socks-proxy-agent/dist/index.js:5:33)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/make-fetch-happen/lib/agent.js:161:25)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
[27/10/2021, 09:34:47] Loaded plugin: homebridge-config-ui-x@4.41.3-test.2
[27/10/2021, 09:34:47] Registering platform 'homebridge-config-ui-x.config'
[27/10/2021, 09:34:47] ---
Environment:
- Node.js Version: 14.18.1 -> 16.13.0
- NPM Version: 6.14.15 -> 8.1.0
- Homebridge Version: 1.3.6-beta.1
- Operating System: Raspbian (HB Image)
Issue Analytics
- State:
- Created 2 years ago
- Comments:34 (2 by maintainers)
Top Results From Across the Web
Class extends value undefined is not a function or null - ...
I am getting the following error when trying to create these entities. TypeError: Class extends value undefined is ...
Read more >Class extends value undefined is not a constructor or null ...
TypeError: Class extends value undefined is not a constructor or null in @aws-sdk/client-cloudwatch-events #3389 ; bug This issue is a bug.
Read more >Class extends value undefined is not a constructor or null ...
Initial searching seems to imply that this indicates an issue with a circular dependency. Might have to be a separate issue, but there...
Read more >class extends value undefined is not a constructor or null ...
TypeError : Class extends value undefined is not a function or null. Start > Run > AppWiz.cpl > Uninstall node.js. Delete the node...
Read more >TypeError: Class extends value undefined is not ...
[moved to issue] Tutorial problem: TypeError: Class extends value undefined is not a constructor or null - Get Help and Help Others -...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks to @sw33tT and @SeydX for your fixes. I will rewrite here what seems to be working for most users (seydx solution):
@christiantschoerner for future reference you should avoid using odd (as opposed to even) version numbers of node as they aren’t supported by homebridge. doesn’t mean it won’t work… but it’s not recommended