Wednesday, 19 April 2017

Error running npm install on Raspberry Pi

Ive got the latest versions for node and npm, but I get this error. So I followed the quick and dirty option here and it built(https://github.com/fivdi/onoff/wiki/Node.js-v0.10.29-and-native-addons-on-the-Raspberry-Pi)

The error was:

pi@raspberrypi:/www/aism $ sudo npm install
npm WARN engine dotenv@4.0.0: wanted: {"node":">=4.6.0"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine deasync@0.1.9: wanted: {"node":">=0.11.0"} (current: {"node":"0.10.29","npm":"1.4.21"})

> deasync@0.1.9 install /www/aism/node_modules/locus/node_modules/deasync
> node ./build.js

make: Entering directory '/www/aism/node_modules/locus/node_modules/deasync/build'
  CXX(target) Release/obj.target/deasync/src/deasync.o
In file included from ../src/deasync.cc:3:0:
../node_modules/nan/nan.h:326:47: error: ‘REPLACE_INVALID_UTF8’ is not a member of ‘v8::String’
   static const unsigned kReplaceInvalidUtf8 = v8::String::REPLACE_INVALID_UTF8;
                                               ^
deasync.target.mk:82: recipe for target 'Release/obj.target/deasync/src/deasync.o' failed
make: *** [Release/obj.target/deasync/src/deasync.o] Error 1
make: Leaving directory '/www/aism/node_modules/locus/node_modules/deasync/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/share/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:809:12)
gyp ERR! System Linux 4.4.11-v7+
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /www/aism/node_modules/locus/node_modules/deasync
gyp ERR! node -v v0.10.29
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok 
Build failed
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! error rolling back Error: ENOTEMPTY, rmdir '/www/aism/node_modules/locus/node_modules/cli-color/node_modules/es5-ext/test/number/is-integer'
npm ERR! error rolling back  locus@1.2.0 { [Error: ENOTEMPTY, rmdir '/www/aism/node_modules/locus/node_modules/cli-color/node_modules/es5-ext/test/number/is-integer']
npm ERR! error rolling back   errno: 53,
npm ERR! error rolling back   code: 'ENOTEMPTY',
npm ERR! error rolling back   path: '/www/aism/node_modules/locus/node_modules/cli-color/node_modules/es5-ext/test/number/is-integer' }
npm ERR! deasync@0.1.9 install: `node ./build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the deasync@0.1.9 install script.
npm ERR! This is most likely a problem with the deasync package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./build.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls deasync
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 4.4.11-v7+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /www/aism
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm ERR! EEXIST, mkdir '/www/aism/node_modules/locus/node_modules/cli-color/node_modules/es5-ext/test/object'
File exists: /www/aism/node_modules/locus/node_modules/cli-color/node_modules/es5-ext/test/object
Move it away, and try again. 

npm ERR! System Linux 4.4.11-v7+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /www/aism
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! path /www/aism/node_modules/locus/node_modules/cli-color/node_modules/es5-ext/test/object
npm ERR! fstream_path /www/aism/node_modules/locus/node_modules/cli-color/node_modules/es5-ext/test/object/map-keys.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code EEXIST
npm ERR! errno 47
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:171:23
npm ERR! fstream_stack /usr/lib/nodejs/mkdirp/index.js:46:53
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /www/aism/npm-debug.log
npm ERR! not ok code 0

Now I got:

pi@raspberrypi:/usr/include/nodejs/deps/v8/include $ sudo nano v8.h
pi@raspberrypi:/usr/include/nodejs/deps/v8/include $ cd /
pi@raspberrypi:/ $ cd www/aism/
pi@raspberrypi:/www/aism $ ls
app.js  node_modules  npm-debug.log  package.json  public  README.md  saveState.json
pi@raspberrypi:/www/aism $ npm install
npm WARN engine deasync@0.1.9: wanted: {"node":">=0.11.0"} (current: {"node":"0.10.29","npm":"1.4.21"})
|
> deasync@0.1.9 install /www/aism/node_modules/locus/node_modules/deasync
> node ./build.js

make: Entering directory '/www/aism/node_modules/locus/node_modules/deasync/build'
  CXX(target) Release/obj.target/deasync/src/deasync.o
  SOLINK_MODULE(target) Release/obj.target/deasync.node
  SOLINK_MODULE(target) Release/obj.target/deasync.node: Finished
  COPY Release/deasync.node
make: Leaving directory '/www/aism/node_modules/locus/node_modules/deasync/build'
Installed in `/www/aism/node_modules/locus/node_modules/deasync/bin/linux-arm-node-0/deasync.node`
locus@1.2.0 node_modules/locus
├── stack-trace@0.0.9
├── prompt@0.2.14 (revalidator@0.1.8, pkginfo@0.4.0, read@1.0.7, winston@0.8.3, utile@0.2.1)
├── cli-color@1.2.0 (ansi-regex@2.1.1, d@1.0.0, timers-ext@0.1.2, es6-iterator@2.0.1, memoizee@0.4.4, es5-ext@0.10.15)
└── deasync@0.1.9 (bindings@1.2.1, nan@2.6.2)

The solution proposed in the article is to downloade the nodejs binaries directly but for example, my node -v returns v0.10.29 yet in this listing (https://nodejs.org/dist/latest/) I only see v7.9.0 for what would be right for my rpi2, armv7, so would it be the node-v7.9.0-linux-armv7l.tar.gz file?

Then the article suggests some additional binaries as well, which are here in this listing (https://nodejs.org/dist/) and thats a huge list. Im confused as to how to pick and what to pick. Help me pick the right binaries. Should I maybe only download 1 file or 2 including the additional binaries?

Thanks



via marciokoko

No comments:

Post a Comment