-
Notifications
You must be signed in to change notification settings - Fork 91
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
npm install i2c failed #75
Comments
I have the same problem on node v4.2.1 and npm v2.14.7. |
+1 |
5 similar comments
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
1 similar comment
+1 |
I ran to same problem and then gave rasp2c a try. |
For anyone having this issue on the Raspberry Pi. It's an incompatibility between the I2C package and newer versions of Node.js. As a workaround you can install Node.js version 0.12.6 (which still works with the library) from here - http://node-arm.herokuapp.com/node_archive_armhf.deb If the author doesn't fix this soon I'll fork it and get it running for Node >= 4.x as this package is starting to look abandoned... |
@alphacharlie -- Please do!!! |
@alphacharlie Oh Charlie, please do :-) |
A fix would be appreciated, there's quite a few projects that depend on i2c and are now broken. |
I forked the code off and updated it to use 'nan' for buffer creation. Will someone please try this and let me know how it works for them? https://github.com/alphacharlie/node-i2c (Otherwise I'll have to put some hardware together to test it myself. Probably take a few days for me to get to it...) For any developers who wish to test you would need to clone the repo into your project and install it manually. This would look something like-
This should put the new i2c package in your node_modules and package.json. You would also want to remove any reference to the i2c package on npmjs.com. |
I have a setup laying in the office, I'll test it tomorrow and report back |
I installed node 4.4.5 and then the newest version of node-i2c on a Rasperry 1 B and it failed. |
@Maus34 - how exactly did you try to install it? (you would have to download it from the link above not from npm...)
Note - I don't have a raspberry pi 1b to test with. But the above compiles and installs successfully for me on both Node 4.x and Node 6.x on the raspberry pi 2b. (Whether it actually works remains to be seen. I don't have the hardware set up to test it right now...) |
@alphacharlie |
@Maus34 - Hmmm not sure what is going on... From your debug file it is trying to install it into ~/tmp/node_modules/i2c and failing. But from the commands I gave, it should just build in place in ~/tmp/node-i2c Can you give more of the terminal output (mess.txt)? I think whatever the actual error was is probably 10-20 lines above what you\ posted... |
@ Alphacharlie |
@Maus34 - You might do - Also, The code at https://github.com/alphacharlie/node-i2c has been updated. (I finished the conversion to the Nan module.) So anyone testing the fix will want to re-download it. If it works for everybody I'll do a pull request and see if @kelly will merge it. |
@alphacharlie |
@Maus34 - Huzzah! If you get a chance to test it, please post back with any results... :-) |
Hello All Good News - Just got done testing this package on actual I2c hardware (ADS1015 ADC) and it worked for me without errors! Looking for more developers to confirm that it also works for them. To test you can replace the dependency in the applicable Package.json file. So this:
becomes this:
then rebuild the your node app. **Note - if you are an end user trying to fix a broken install, then you'll probably have to do - |
@alphacharlie awesome! Thanks for putting this together and making the switch to Nan. Send me a PR when you have a chance. I'll look everything over and get it merged in. |
@alphacharlie |
@Maus34 - Can you post your package.json? |
The text was updated successfully, but these errors were encountered: