Closed JohnNavratil closed 8 years ago
+1
Same issue here ...
+1
I have the same issue of it not compiling on a BeagleBone with Debian and Node v4.0.0.0 .
Exactly the same issue here.
(as a dependency of cylon-raspi)
node 4.0 requires a major re-write of native v8 modules. I likely won't be able to get to this for sometime. If someone wants to tackle it and send me a pull request, i'll merge it, and submit a release.
Kelly,
Thanks for the heads up. In theory I could do this (I've been a C programmer for years, I'm not a C++ maven), but my complete unfamiliarity with the code base makes my success unlikely.
I'm just building a Raspian system and am not married to Node 4.0. Do you have a clue to which node version is compatible with i2c? If not, I'll report back with my results as I try to find one.
The Node version that was compatible with i2c is Node 0.10 Stable Version I have the same problem, when I install cylon-raspi.
That is incorrect, it should work for v0.12.7 and everything before. So everything prior to the 4.0 release.
Oh thanks :D did you how to fix this problem? I2c is no working and I need to install cylon-raspi.
For now just use nvm to install node 0.12.7 and you should be able to use cylon-raspi with i2c.
This pull request is working: https://github.com/kelly/node-i2c/pull/70/commits You can implement it immediately using the following snippet in your packages.json. "i2c": "https://github.com/polaris/node-i2c"
+1 need this :)
Anvanza, I don't suppose there is a way you can show me how to do this, or point me in the direction of some generic instructions. Am still quite new to this!
TIA
Anvanza, never mind, I didn't take your comment literally enough. Works great for lots of my sensors, Thanks for the heads-up!
If your application has a module which has node-i2c
as a subpackage, rather than modify the module, just install the workaround version globally.
npm install -g https://github.com/jnovack/node-i2c/archive/master.zip
git clone https://github.com/jnovack/node-i2c/
cd node-i2c/
npm install -g .
When you npm install
your application, the module will see you already have it and use the local "fixed" copy.
jnovack,
I reviewed yours and anvanza's files and it seems yours is trying to be a more universal solutions. So I tried it, and received....
npm install -g https://github.com/jnovack/node-i2c/archive/master.zip npm ERR! not a package /tmp/npm-19977-c99c1b5a/github.com/jnovack/node-i2c/archive/master.zip npm ERR! Linux 4.1.13+ npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "https://github.com/jnovack/node-i2c/archive/master.zip" npm ERR! node v4.2.4 npm ERR! npm v2.14.12 npm ERR! path /tmp/npm-19977-c99c1b5a/unpack-9d46181a9b21/package.json npm ERR! code ENOENT npm ERR! errno -2 npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/tmp/npm-19977-c99c1b5a/unpack-9d46181a9b21/package.json' npm ERR! enoent This is most likely not a problem with npm itself npm ERR! enoent and is related to npm not being able to find a file. npm ERR! enoent
Any thoughts?
You see the versions of node and npm. This is being installed on a Raspberry Pi running an updated Jessie.
jnovack,
Flying completely by the seat of my pants, and as root (shivver!), I...
wget "https://github.com/jnovack/node-i2c/archive/master.zip" unzip master.zip cd node-i2c-master/ npm -g install .
Things seemed to work. I've not done any testing yet. Thoughts?
Sorry, I tried to make it easy, but stupid npm doesn't see it as a package.
New instructions:
git clone https://github.com/jnovack/node-i2c/
cd node-i2c/
npm install -g .
You can see the changes I've made here. All I've done is isolate node version v4 code as a quick and dirty work-around and set the version to be 0.2.1-alpha.1
. This ensures that any update of the REAL package will overwrite my package.
+1 on this being a problem for my projects
+1
+1
node -v ==> v4.0.0 node-gyp -v ==> v3.0.2 uname -a ==> Linux rpi0 4.1.6+ #810 PREEMPT Tue Aug 18 15:19:58 BST 2015 armv6l GNU/Linux
Many C++ compile errors. I'll be happy to generate a clean npm debug log if someone can tell me how to attach it.
root@rpi0: /home/jnavratil/pmon$ npm -g install i2c
|
make: Entering directory '/usr/local/lib/node_modules/i2c/build' CXX(target) Release/obj.target/i2c/src/i2c.o ../src/i2c.cc: In function 'void ReadBlock(const v8::FunctionCallbackInfov8::Value&)': ../src/i2c.cc:162:47: error: no matching function for call to 'New(int32_t&)' Local
npm ERR! i2c@0.2.1 install:
node-gyp rebuild
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the i2c@0.2.1 install script 'node-gyp rebuild'. npm ERR! This is most likely a problem with the i2c package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-gyp rebuild npm ERR! You can get their info via: npm ERR! npm owner ls i2c npm ERR! There is likely additional logging output above.npm ERR! Please include the following file with any support request: npm ERR! /home/jnavratil/pmon/npm-debug.log