kelly / node-i2c

Node.js native bindings for i2c-dev. Plays well with Raspberry Pi and Beaglebone.
Other
216 stars 91 forks source link

Install problems #78

Closed Maus34 closed 8 years ago

Maus34 commented 8 years ago

I installed the latest version with npm install i2c Compiling worked well with gcc 4.8 and I got the folder /home/pi/node-i2c But in node I do not have the module i2c: I checked with npm -g ls and I have no entry in npm\package.json.

kelly commented 8 years ago

Did you install i2c globally?

sudo npm install i2c -g
Maus34 commented 8 years ago

I did sudo npm install i2c -g and got the folder /usr/local/lib/node_modules/i2c in node: > var i2c = require('i2c'); gives me Error: Cannot find module i2c I checked again with npm -g ls and in npm\package.json. Manually: var i2c = require('/usr/local/lib/node_modules/i2c'); gives me undefined The owner of /usr/local/lib/node_modules/i2c was nobody I changed it to root and then to pi, but no change

I tried it on my new Raspberry 3, but with the same result

Maus34 commented 8 years ago

works now. I used the wrong folder