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

I2C does not work in the latest node version #98

Open
jscaglia opened this issue Sep 24, 2019 · 5 comments
Open

I2C does not work in the latest node version #98

jscaglia opened this issue Sep 24, 2019 · 5 comments

Comments

@jscaglia
Copy link

Hi, I tried to install de node module to mi nodejs app but I can't. I suppose that the reason is my nodejs and NPM version.
Do you know if the library is not compatible with the last version of nodeJS? If this is the case, do you know how I could install it?

Regards.

@zvaehn
Copy link

zvaehn commented Nov 18, 2019

I have tried the following and it worked for me (somehow):

  1. npm list -g | head -1 which gives you your global npm directory
    (in my case /home/pi/.nvm/versions/node/v8.0.0/lib)
  2. Change your working dir to this directory (cd ...)
  3. Try a regular npm install i2c which will install i2c and it's dependencies in the subfolder node_modules
  4. In my case i was able to install the package depending on i2c without sudo and it worked.

@shidevil
Copy link

Does it work on node12?

@rzr
Copy link

rzr commented Feb 24, 2020

Meanwhile linked patch is merged , you can use:

https://www.npmjs.com/package/@abandonware/i2c

@jscaglia
Copy link
Author

I have tried the following and it worked for me (somehow):

  1. npm list -g | head -1 which gives you your global npm directory
    (in my case /home/pi/.nvm/versions/node/v8.0.0/lib)
  2. Change your working dir to this directory (cd ...)
  3. Try a regular npm install i2c which will install i2c and it's dependencies in the subfolder node_modules
  4. In my case i was able to install the package depending on i2c without sudo and it worked.

Unfortunately it didn't work for me. My global npm directory is '/usr/local/lib' and when I tried install with and without sudo print this.

pi@raspberrypi:/usr/local/lib $ sudo npm install i2c
npm WARN npm npm does not support Node.js v10.19.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
npm WARN deprecated [email protected]: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)

[email protected] install /usr/local/lib/node_modules/i2c
node-gyp rebuild

gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/i2c/build'
gyp ERR! System Linux 4.19.97-v7+
gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/i2c
gyp ERR! node -v v10.19.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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/2020-05-27T12_32_55_247Z-debug.log

@rzr
Copy link

rzr commented May 27, 2020

Relate-to: #96

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

No branches or pull requests

4 participants