maxwellhadley / node-red-contrib-htu21d

Node-RED node for HTU21D humidity sensors
BSD 2-Clause "Simplified" License
1 stars 2 forks source link

Cannot find module ./build/Release/htu21d #1

Closed jamms closed 8 years ago

jamms commented 8 years ago

Hi Maxwell,

I have installed and am testing node-red on raspberry-pi B. Having followed your instructions, I start Node Red and get this error (using -v).

[htu21d] Error: Cannot find module './build/Release/htu21d'

Only changes I have made on this Pi since I installed the latest Raspbian build is uninstall node-red that came with Raspian and manually install node js 4.3.1 and put node-red back on.

Any ideas how to troubleshoot this?

maxwellhadley commented 8 years ago

jamms,

If you have updated node.js, you will need to ensure that the htu21d package, which node-red-contrib-htu21d depends on, is recompiled to suit the new version of node.js. This package is mostly written in C++. The best thing to do is probably to cd to the node_modules directory continuing this package (inside node-red-contrib-htu21d), delete the htu21d directory and its contents, then 'sudo npm install —unsafe-perms htu21d’

I don’t have working system with this node installed handy, but if you get stuck, I’ll dig it out of the pile! It was last used on a 0.10.x version of node.js, so it may take me a while to get up to speed…

Cheers

Max

On 2 Mar 2016, at 19:36, jamms notifications@github.com wrote:

Hi Maxwell,

I have installed and am testing node-red on raspberry-pi B. Having followed your instructions, I start Node Red and get this error (using -v).

[htu21d] Error: Cannot find module './build/Release/htu21d'

Only changes I have made on this Pi since I installed the latest Raspbian build is uninstall node-red that came with Raspian and manually install node js 4.3.1 and put node-red back on.

Any ideas how to troubleshoot this?

— Reply to this email directly or view it on GitHub https://github.com/maxwellhadley/node-red-contrib-htu21d/issues/1.

jamms commented 8 years ago

Hi Max,

Thanks for quick response! I did try what you suggested but the problem still occurs. Not sure if this error message I get when I install htu21d is any kind of clue?

npm WARN cannot run in wd htu21d@0.2.0 node-gyp rebuild (wd=/home/pi/.node-red/node_modules/node-red-contrib-htu21d/node_modules/htu21d) htu21d@0.2.0 htu21d

Cheers,

Jamms

maxwellhadley commented 8 years ago

Jamms,

I think the error means node-gyp cannot cd to or otherwise access the working directory for the module. Does this directory exist? what are the owner & permissions? Did you ‘sudo’ the npm install command, and use the —unsafe-perms switch?

I see you are running the very latest node.js 4.3.1 LTS. The most recent I’ve tried is 0.12.x, so you are pioneering here! If you are still stuck, raise an issue at https://github.com/sonnens/node-htu21d as i think this package is the root of the problem. One day I’ll eventually get round to updating my BBB which I use with this node.

Cheers,

Max

On 2 Mar 2016, at 20:41, jamms notifications@github.com wrote:

Hi Max,

Thanks for quick response! I did try what you suggested but the problem still occurs. Not sure if this error message I get when I install htu21d is any kind of clue?

npm WARN cannot run in wd htu21d@0.2.0 node-gyp rebuild (wd=/home/pi/.node-red/node_modules/node-red-contrib-htu21d/node_modules/htu21d) htu21d@0.2.0 htu21d

Cheers,

Jamms

— Reply to this email directly or view it on GitHub https://github.com/maxwellhadley/node-red-contrib-htu21d/issues/1#issuecomment-191420401.

jamms commented 8 years ago

Hi Maxwell, The directory didn't exist, I've had similar problems before though and got round them. To be honest, I've got several other sensors not working in Node 4.x as well and although some of the issues are down to node ic2, I gave up and used the stock version of Node 0.10.x from Raspian and everything 'just works'. Life is too short sometimes! Thanks,

Jamms