Getting Error: Cannot find module './out/NodeIMU' when running per README
Closed this issue · 10 comments
I think there are steps/deps missing, possibly you need to include instructions for compiling the CPP code?
What platform and architecture are you using?
I'm using Raspbian Jessie
I'm using Raspbian Jessie - I don't remember setting up anything special in order to build other than build essentials...
See what error you get if you run:
npm install --verbose
Maybe I can help you based on the output...
Btw, I installed node like this:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.29.0/install.sh | bash
Restart bash or run:
export NVM_DIR="/home/pi/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
Then:
nvm install 0.12
nvm use 0.12
nvm alias default v0.12
Thanks @rupnikj ... Was able to install nvm with no problem, then had to run npm install
again, after which it successfully built the out
directory.
I installed node another way. Not sure that I want to install it differently. I am using version 5.6.0 and when I run the sudo npm install
I get this error;
npm WARN lifecycle nodeimu@2.1.6~install: cannot run in wd %s %s (wd=%s) nodeimu@2.1.6 node-gyp rebuild /home/pi/projects/nodeimu
And still no out
dir.
Looks like an issue with running npm with a sudo user:
http://stackoverflow.com/questions/18136746/npm-install-failed-with-cannot-run-in-wd
npm/npm#3497
Thanks. I would not have used sudo if I wasn't trying anything to get this to work. Do you think this is a version compatibility issue? The first error I get (out of numerous) when I run sudo npm install --unsafe-perm
is:
../node_modules/nan/nan.h:41:3: error: #error This version of node/NAN/v8 requires a C++11 compiler
Why are you using such an old version (0.12) of node?
It should work on newer versions as well - it compiles with node 4 and 5...
I've just tested it on raspbian jessie:
cd ~
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.29.0/install.sh | bash
export NVM_DIR="/home/pi/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
nvm install 5
nvm use 5
and then building the module using:
npm install --verbose
node test
I was on Raspbian Wheezy. I upgraded to Jessie and it installs no problem now,as long as I use the --unsafe-perm
flag.
sudo npm install --unsafe-perm
If anyone would like to learn from my mistake.