pimatic / pimatic-homeduino

Pimatic plugin for using 433mhz devices and sensors with a connected Arduino with homeduino sketch
https://pimatic.org/
GNU General Public License v2.0
37 stars 29 forks source link

Could not initialize #93

Closed PSi86 closed 5 years ago

PSi86 commented 5 years ago

After updating to the current version of pimatic-homeduino plugin I get the following error after each restart of pimativ and all homeduino devices are not working anymore:

error [pimatic]: Could not initialize the plugin "homeduino": Module version mismatch. Expected 46, got 64.

Log (only relevant entries): 15:23:22.117 [pimatic] info: Installing: "pimatic-homeduino@0.9.16" from npm-registry. 15:24:00.121 [pimatic, ppm] info: WARN unmet dependency /home/pi/pimatic-app/node_modules/pimatic/node_modules/express requires body-parser@'1.18.3' but will load 15:24:00.131 [pimatic, ppm] info: WARN unmet dependency /home/pi/pimatic-app/node_modules/pimatic/node_modules/body-parser, 15:24:00.144 [pimatic, ppm] info: WARN unmet dependency which is version 1.19.0 15:24:00.504 [pimatic, ppm] info: pimatic-homeduino@0.9.16 node_modules/pimatic-homeduino 15:24:24.984 [pimatic] info: Restarting... 15:24:24.995 [pimatic] info: Flushing database to disk, please wait... 15:24:25.155 [pimatic] info: Flushing database to disk, please wait... Done. 15:24:26.103 [pimatic] info: exiting... 15:24:27.949 2019-05-30 Thursday 15:24:33.337 [pimatic] info: Starting pimatic version 0.9.48 15:24:33.346 [pimatic] info: Node.js version 4.8.2 15:24:33.349 [pimatic] info: OpenSSL version 1.0.2k 15:24:35.597 [pimatic, ppm] info: 2.15.12 15:24:36.838 [pimatic] info: Loading plugin: "pimatic-homeduino" (0.9.16) coffee-cache: compiling coffee-script file "homeduino.coffee"...Done coffee-cache: compiling coffee-script file "homeduino-config-schema.coffee"...Done 15:24:45.785 [pimatic] error: Could not initialize the plugin "homeduino": Module version mismatch. Expected 46, got 64. 15:24:46.864 [pimatic] warn: No plugin found for device "socket1" of class "HomeduinoRFSwitch"! 15:24:46.874 [pimatic] warn: No plugin found for device "socket2" of class "HomeduinoRFSwitch"!

Any ideas what to do to resolve this issue? Thank you!

mwittig commented 5 years ago
cd /home/pi/pimatic-app/node_modules/
sudo rm -r  pimatic-homeduino/
sudo npm install pimatic-homeduino@0.9.15 --unsafe-perm

Then restart pimatic.

PSi86 commented 5 years ago

Thank you! It is working again! Just to give a full feedback, the npm install command gave me the following output, is that expected? Maybe this is a result of my old npm version?

npm WARN engine pimatic-homeduino@0.9.15: wanted: {"node":">= 4","npm":">= 2"} (current: {"node":"4.8.2","npm":"1.4.21"})
npm WARN package.json otaat-repl@1.0.2 license should be a valid SPDX license expression
npm ERR! error rolling back Error: ENOTEMPTY: directory not empty, rmdir '/home/pi/pimatic-app/node_modules/pimatic-homeduino/node_modules/homeduino/node_modules/bluebird/js'
npm ERR! error rolling back     at Error (native)
npm ERR! error rolling back  homeduino@0.0.70 { [Error: ENOTEMPTY: directory not empty, rmdir '/home/pi/pimatic-app/node_modules/pimatic-homeduino/node_modules/homeduino/node_modules/bluebird/js']
npm ERR! error rolling back   errno: -39,
npm ERR! error rolling back   code: 'ENOTEMPTY',
npm ERR! error rolling back   syscall: 'rmdir',
npm ERR! error rolling back   path: '/home/pi/pimatic-app/node_modules/pimatic-homeduino/node_modules/homeduino/node_modules/bluebird/js' }
npm ERR! Error: Method Not Allowed
npm ERR!     at errorResponse (/usr/share/npm/lib/cache/add-named.js:260:10)
npm ERR!     at /usr/share/npm/lib/cache/add-named.js:203:12
npm ERR!     at saved (/usr/share/npm/node_modules/npm-registry-client/lib/get.js:167:7)
npm ERR!     at FSReqWrap.oncomplete (fs.js:82:15)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Linux 4.19.42-v7+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "pimatic-homeduino@0.9.15" "--unsafe-perm"
npm ERR! cwd /home/pi/pimatic-app/node_modules
npm ERR! node -v v4.8.2
npm ERR! npm -v 1.4.21
npm ERR! code E405
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /home/pi/pimatic-app/node_modules/npm-debug.log
npm ERR! not ok code 0
mwittig commented 5 years ago

the npm install command gave me the following output, is that expected?

Possibly. You update to npm v2 as follows:

sudo npm install -g npm@2

Note beyond, 0.9.16 had a packaging problem. The new release 0.9.17 should fix the issue