dgreif / homebridge-mylink

Somfy myLink plugin for Homebridge.
MIT License
8 stars 7 forks source link

Issues on NPM install #7

Closed markcsegal closed 5 years ago

markcsegal commented 5 years ago

I have a relatively clean install of Raspian and I am getting an error on install. pi@raspberrypi:~ $ sudo npm -g install homebridge-mylink (node:9540) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.npm ERR! tar.unpack untar error /root/.npm/generic-pool/3.7.1/package.tgz npm ERR! Error: Invalid Package: expected sinonjs/formatio but found @sinonjs/formatio npm ERR! at /usr/share/npm/lib/cache/add-local-tarball.js:161:14 npm ERR! at _combinedTickCallback (internal/process/next_tick.js:131:7) npm ERR! at process._tickCallback (internal/process/next_tick.js:180:9) 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.14.98-v7+ npm ERR! command "/usr/bin/node" "/usr/bin/npm" "-g" "install" "homebridge-mylink" npm ERR! cwd /home/pi npm ERR! node -v v8.11.1 npm ERR! npm -v 1.4.21 npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /home/pi/npm-debug.log npm ERR! not ok code 0

yungsters commented 5 years ago

There seems to be an issue with your npm cache. See if there’s a command to clear your npm cache before retrying?

markcsegal commented 5 years ago

"sudo npm cache clean" in one of the many tries to make this work.. Just tried again. Same result. Is there something more I should try?

M

markcsegal commented 5 years ago

Btw, I looked at the code of add-local-tarball.js... looks like there is something wrong with the NPM package?

see this routine: function next (er) { if (er) return cb(er) var pj = path.join(target, "package.json") readJson(pj, function (er, data) { // XXX dry with similar stanza in add-local.js er = needName(er, data) er = needVersion(er, data) // check that this is what we expected. if (!er && pkgData.name && pkgData.name !== data.name) { er = new Error( "Invalid Package: expected "

ghost commented 5 years ago

@markcsegal hey, all good? Im experiencing exactly the same issue. Were you able to solve it? Please let me know. My whole setup is based on this code and I just cant install it anymore...

markcsegal commented 5 years ago

Nope never did. But haven’t tried to since the last post. Have been using the native app. Which sucks.

ghost commented 5 years ago

Brother, let's work together then to try to find a better solution. If feels to me that youngsters gave up the project... And I agree: the native app really sucks... I'm exploring now the idea to install Home Assistant in my Pi and then use the Homebridge Plugin to read the devices on the Home Assistant...

markcsegal commented 5 years ago

Fair. I will start up the search again. Will let this thread know if I find something.

yungsters commented 5 years ago

I just noticed this in the original logs:

npm ERR! node -v v8.11.1 npm ERR! npm -v 1.4.21

Your version of npm is extremely outdated. For reference, the latest version is npm@6.11.3.

Please consult the npm documentation for instructions on updating: https://docs.npmjs.com/about-npm-versions

markcsegal commented 5 years ago

FYI I was running a later version.. but forced the upgrade and now it worked. Well a new issue but I can play from here.

-- FYI BELOW --

pi@raspberrypi:~ $ npm -v 6.9.0 pi@raspberrypi:~ $ sudo npm install -g npm (node:9455) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead. npm WARN package.json path-is-inside@1.0.2 No README data npm WARN package.json sorted-object@2.0.1 No README data /usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npx -> /usr/local/lib/node_modules/npm/bin/npx-cli.js npm WARN package.json config-chain@1.1.12 No license field. npm WARN package.json cyclist@0.2.2 No license field. npm WARN package.json json-schema@0.2.3 No license field. npm WARN package.json punycode@1.4.1 punycode is also the name of a node core module. npm WARN package.json qrcode-terminal@0.12.0 No license field. npm WARN package.json string_decoder@1.2.0 string_decoder is also the name of a node core module. npm@6.11.3 /usr/local/lib/node_modules/npm pi@raspberrypi:~ $ sudo npm -g install homebridge-mylink

ref-napi@1.4.0 install /usr/lib/node_modules/homebridge-mylink/node_modules/net-keepalive/node_modules/ref-napi node-gyp rebuild

gyp WARN EACCES user "nobody" does not have permission to access the dev dir "/root/.cache/node-gyp/8.11.1" gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/homebridge-mylink/node_modules/net-keepalive/node_modules/ref-napi/.node-gyp" gyp WARN install got an error, rolling back install gyp WARN install got an error, rolling back install gyp ERR! configure error gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/homebridge-mylink/node_modules/net-keepalive/node_modules/ref-napi/.node-gyp' gyp ERR! System Linux 4.14.98-v7+ gyp ERR! command "/usr/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /usr/lib/node_modules/homebridge-mylink/node_modules/net-keepalive/node_modules/ref-napi gyp ERR! node -v v8.11.1 gyp ERR! node-gyp -v v5.0.3 gyp ERR! not ok npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! ref-napi@1.4.0 install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the ref-napi@1.4.0 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2019-09-26T18_24_03_383Z-debug.log pi@raspberrypi:~ $

markcsegal commented 5 years ago

forgot --unsafe-perm.

Installed now. Working on Configuring my many units.
Thanks.