Node-red-contrib-openhab3 MODULE_NOT_FOUND

Hi!
I update my OpenHAB to 3.0 version and want to connect it to Node-RED.
I nstall node-red-contrib-openhab3 but i have error on palette manager like picture.
I cant uninstall node, I cant reinstall node.

In NodeRed log window:

2021-08-31T19:22:23.570Z npm remove --no-audit --no-update-notifier --no-fund --save node-red-contrib-openhab3
2021-08-31T19:22:31.665Z [err] npm
2021-08-31T19:22:31.666Z [err]  ERR! Unexpected token o in JSON at position 1 while parsing near ' opened for user root...'
2021-08-31T19:22:33.857Z [err] 
2021-08-31T19:22:33.858Z [err] npm ERR!
2021-08-31T19:22:33.859Z [err]  A complete log of this run can be found in:
2021-08-31T19:22:33.859Z [err] npm ERR!     /home/pi/.npm/_logs/2021-08-31T19_22_31_673Z-debug.log
2021-08-31T19:22:33.888Z rc=1

In log file 2021-08-31T19_22_31_673Z-debug.log:

17 silly saveTree в”‚   в”њв”Ђв”Ђ @serialport/stream@9.0.7
17 silly saveTree в”‚   в””в”Ђв”Ђ debug@4.3.2
17 silly saveTree в””в”Ђв”Ђ node-red-node-smooth@0.1.2
18 verbose stack SyntaxError: Unexpected token o in JSON at position 1 while parsing near ' opened for user root...'
18 verbose stack     at JSON.parse (<anonymous>)
18 verbose stack     at parseJson (/usr/lib/node_modules/npm/node_modules/json-parse-better-errors/index.js:7:17)
18 verbose stack     at module.exports (/usr/lib/node_modules/npm/lib/utils/parse-json.js:4:10)
18 verbose stack     at parsePkgLock (/usr/lib/node_modules/npm/lib/install/read-shrinkwrap.js:67:12)
18 verbose stack     at /usr/lib/node_modules/npm/lib/install/read-shrinkwrap.js:27:22
18 verbose stack     at tryCatcher (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
18 verbose stack     at Holder$2._callFunction (eval at generateHolderClass (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/join.js:92:16), <anonymous>:14:44)
18 verbose stack     at Holder$2.checkFulfillment (eval at generateHolderClass (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/join.js:92:16), <anonymous>:29:30)
18 verbose stack     at Promise.eval (eval at thenCallback (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/join.js:14:16), <anonymous>:6:20)
18 verbose stack     at Promise._settlePromise (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:571:21)
18 verbose stack     at Promise._settlePromise0 (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:619:10)
18 verbose stack     at Promise._settlePromises (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:699:18)
18 verbose stack     at Promise._fulfill (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:643:18)
18 verbose stack     at Promise._settlePromise (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:587:21)
18 verbose stack     at Promise._settlePromise0 (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:619:10)
18 verbose stack     at Promise._settlePromises (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:699:18)
19 verbose cwd /home/pi/.node-red
20 verbose Linux 5.10.17-v7+
21 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "--no-audit" "--no-update-notifier" "--no-fund" "--save" "--save-prefix=~" "--production" "--engine-strict" "node-red-contrib-openhab3@1.3.14"
22 verbose node v14.17.5
23 verbose npm  v6.14.14
24 error Unexpected token o in JSON at position 1 while parsing near ' opened for user root...'
25 verbose exit [ 1, true ]

What is it? And how i can reinstall node for OpenHAB3?

Something is messed up somewhere. Go into your .node-red folder and run
npm cache clear --force
Then
npm remove node-red-contrib-openhab3
If that shows errors then paste the output here. If it succeeds then run
npm install node-red-contrib-openhab3

After run "npm remove node-red-contrib-openhab3":

pi@raspberrypi:~ $ npm remove node-red-contrib-openhab3
npm WARN saveError ENOENT: no such file or directory, open '/home/pi/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/pi/package.json'
npm WARN pi No description
npm WARN pi No repository field.
npm WARN pi No README data
npm WARN pi No license field.

removed 1 package and audited 78 packages in 7.729s

2 packages are looking for funding
  run `npm fund` for details

found 6 vulnerabilities (4 moderate, 2 high)
  run `npm audit fix` to fix them, or `npm audit` for details

Node Node-red-contrib-openhab3 removed from manage palette. But i still cant install it.

hmmm... and now i cant install any node...

You do not appear to have followed my suggestion, in particular:

You will need to do the cache clear again as you were not in that folder.

Ooops...

pi@raspberrypi:~ $ cd $HOME/.node-red/
pi@raspberrypi:~/.node-red $ npm cache clear --force
npm WARN using --force I sure hope you know what you are doing.
pi@raspberrypi:~/.node-red $ npm remove node-red-contrib-openhab3
npm ERR! Unexpected token o in JSON at position 1 while parsing near ' opened for user root...'

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pi/.npm/_logs/2021-08-31T21_26_55_582Z-debug.log
pi@raspberrypi:~/.node-red $

Can you post your package.json file please (from that folder). Perhaps that is messed up.

It is package.json from /home/pi/.node-red folder.

{
  "name": "node-red-project",
  "description": "initially created for you by Node-RED 2.0.5 ",
  "version": "0.0.1",
  "private": true,
  "dependencies": {
    "node-red-contrib-openhab3": "~1.3.14",
    "node-red-contrib-play-audio": "^2.5.0",
    "node-red-node-pi-gpio": "^1.2.3",
    "node-red-node-ping": "^0.3.1",
    "node-red-node-random": "^0.4.0",
    "node-red-node-serialport": "^0.14.1",
    "node-red-node-smooth": "^0.1.2"
  }

That doesn't look complete, are you sure that is all of it? At least there is a } missing from the end.

Thanks a lot!
I don’t know how I removed the parenthesis in the file.

Do you mean the parenthesis is really missing? If so then add it and try again.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.