Skip to content
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

Error uninstalling or updating TCC plugin #138

Open
ibogost opened this issue Oct 14, 2023 · 10 comments
Open

Error uninstalling or updating TCC plugin #138

ibogost opened this issue Oct 14, 2023 · 10 comments
Labels

Comments

@ibogost
Copy link

ibogost commented Oct 14, 2023

Analysis

Cannot reinstall or uninstall TCC plugin. Worked previously, but I updated to a new Homebridge Docker image and now it cannot load nor uninstall/reinstall.

Expected Behavior

Update plugin or uninstall plugin from Homebridge plugin UI

Steps To Reproduce

  1. Choose Uninstall from Homebridge plugin interface or
  2. Choose Install Alternate version from Homebridge plugin interface

Logs

USER: root
DIR: /var/lib/homebridge
CMD: npm uninstall --save homebridge-tcc

npm ERR! Cannot read properties of null (reading 'matches')

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/homebridge/.npm/_logs/2023-10-14T15_50_28_220Z-debug-0.log

Operation failed. Please review log for details.

Configuration

N/A

Environment

  • OS: Ubuntu Jammy Jellyfish (22.04.3 LTS)
  • Homebridge: 1.6.1
  • Node: 18.16.0
  • npm: 9.5.1

Process Supervisor

Docker (Mention image name in Additional Context)

Additional Context

Image name Homebridge-homebridge

Tail of the log error is attached.

log.txt

@ibogost ibogost added the bug label Oct 14, 2023
@ibogost
Copy link
Author

ibogost commented Oct 15, 2023

Looks like this may be unrelated to TCC and instead a more general Node issue, although I’m still not sure how to resolve it if so.

@NorthernMan54
Copy link
Owner

Maybe update NodeJS to the latest version will reset the node environment ?

Also was there anything interesting in this file - /home/homebridge/.npm/_logs/2023-10-14T15_50_28_220Z-debug-0.log

@ibogost
Copy link
Author

ibogost commented Oct 15, 2023

I left the tail of the file in the OP, but it didn't contain anything I could decode. Here's the end:

11148 verbose stack TypeError: Cannot read properties of null (reading 'matches')
11148 verbose stack at Link.matches (/opt/homebridge/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/node.js:1119:41)
11148 verbose stack at Link.canDedupe (/opt/homebridge/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/node.js:1073:15)
11148 verbose stack at PlaceDep.pruneDedupable (/opt/homebridge/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/place-dep.js:426:14)
11148 verbose stack at PlaceDep.pruneDedupable (/opt/homebridge/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/place-dep.js:450:16)
11148 verbose stack at new PlaceDep (/opt/homebridge/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/place-dep.js:219:12)
11148 verbose stack at /opt/homebridge/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:943:31
11148 verbose stack at Array.map ()
11148 verbose stack at [buildDepStep] (/opt/homebridge/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:943:8)
11148 verbose stack at async Arborist.buildIdealTree (/opt/homebridge/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:207:7)
11148 verbose stack at async Promise.all (index 1)
11149 verbose cwd /homebridge
11150 verbose Linux 4.4.180+
11151 verbose node v18.16.0
11152 verbose npm v9.5.1
11153 error Cannot read properties of null (reading 'matches')
11154 verbose exit 1
11155 timing npm Completed in 168014ms
11156 verbose unfinished npm timer reify 1697298628308
11157 verbose unfinished npm timer reify:loadTrees 1697298628311
11158 verbose unfinished npm timer idealTree:buildDeps 1697298630553
11159 verbose unfinished npm timer idealTree:node_modules/.pnpm/ajv@6.12.6/node_modules/ajv 1697298748423
11160 verbose unfinished npm timer idealTree:node_modules/.pnpm/bluebird@3.4.7/node_modules/bluebird 1697298776374
11161 verbose unfinished npm timer idealTree:node_modules/.pnpm/cross-spawn@7.0.3/node_modules/babel-eslint 1697298795391
11162 verbose code 1

I was thinking of trying an npm rebuild, but maybe updating would also do it.

@NorthernMan54
Copy link
Owner

Nothing in there jumps out to me

I'm stumped

@ibogost
Copy link
Author

ibogost commented Oct 15, 2023

Yeah. It's weird. I can't even get npm rebuild to run. I guess I could recreate the container.

@ibogost
Copy link
Author

ibogost commented Oct 15, 2023

This was the original error message I got for TCC when booting the container. No problem, I thought, I'll just update it. But now I can't update, install, or uninstall this or any plugins. Anything in here look helpful?

[10/15/2023, 6:41:13 PM] ====================
[10/15/2023, 6:41:13 PM] ERROR LOADING PLUGIN homebridge-tcc:
[10/15/2023, 6:41:13 PM] Error: The module '/homebridge/node_modules/.pnpm/node-expat@2.4.0/node_modules/node-expat/build/Release/node_expat.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 93. This version of Node.js requires
NODE_MODULE_VERSION 108. Please try re-compiling or re-installing
the module (for instance, using npm rebuild or npm install).
at Object.Module._extensions..node (node:internal/modules/cjs/loader:1338:18)
at Module.load (node:internal/modules/cjs/loader:1117:32)
at Function.Module._load (node:internal/modules/cjs/loader:958:12)
at Module.require (node:internal/modules/cjs/loader:1141:19)
at require (node:internal/modules/cjs/helpers:110:18)
at bindings (/homebridge/node_modules/.pnpm/bindings@1.5.0/node_modules/bindings/bindings.js:112:48)
at Object. (/homebridge/node_modules/.pnpm/node-expat@2.4.0/node_modules/node-expat/lib/node-expat.js:4:34)
at Module._compile (node:internal/modules/cjs/loader:1254:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
at Module.load (node:internal/modules/cjs/loader:1117:32)

@NorthernMan54
Copy link
Owner

That message is pretty typical after an update of NodeJS, and the usual fix it to run npm rebuild or just install the plugin again.

@ibogost
Copy link
Author

ibogost commented Oct 15, 2023

That's what I thought too. But I can't run npm rebuild, and I can't uninstall or reinstall the plugin, because I get the error initially reported.

Should I just delete node_modules and restart my container? Will homebridge rebuild its dependencies automatically?

@NorthernMan54
Copy link
Owner

Homebridge won't rebuild its dependencies automatically

What about creating a new container, and restoring a homebridge UI backup from the existing container ? It should install / update all you plugins.

@ibogost
Copy link
Author

ibogost commented Oct 15, 2023

Yes, that seems like the best approach. I'll try it next. Thanks for the input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants