kartben / eclipseiot-demobox

7 stars 2 forks source link

Install npm #6

Open mmilinkov opened 8 years ago

mmilinkov commented 8 years ago

When I followed the instructions and ran setup.sh I got an error:

            ./setup.sh: line 3: npm: command not found

Perhaps npm should be added to the list of things to install? E.g.

            sudo apt-get install screen node **npm** git cmake build-essential iceweasel
mmilinkov commented 8 years ago

Okay, so installing npm separately, and running npm install separately didn't work. I got a whole lot of error messages along the lines of:

         npm WARN This failure might be due to the use of legacy binary "node"
mmilinkov commented 8 years ago

I am pretty sure that the right way to install these on Jessie is:

  sudo apt-get install nodejs npm 

Note the 'nodejs' rather than 'node'

mmilinkov commented 8 years ago
No joy on that either. Running npm install results in the following: ``` npm WARN package.json async@1.4.2 No README data | > pty.js@0.3.0 install /home/pi/eclipseiot-demobox/node_modules/pty.js > node-gyp rebuild make: Entering directory '/home/pi/eclipseiot-demobox/node_modules/pty.js/build' CXX(target) Release/obj.target/pty/src/unix/pty.o In file included from ../src/unix/pty.cc:20:0: ../node_modules/nan/nan.h:318:47: error: âREPLACE_INVALID_UTF8â is not a member of âv8::Stringâ static const unsigned kReplaceInvalidUtf8 = v8::String::REPLACE_INVALID_UTF8; ^ pty.target.mk:82: recipe for target 'Release/obj.target/pty/src/unix/pty.o' failed make: *** [Release/obj.target/pty/src/unix/pty.o] Error 1 make: Leaving directory '/home/pi/eclipseiot-demobox/node_modules/pty.js/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.1.6-v7+ gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild" gyp ERR! cwd /home/pi/eclipseiot-demobox/node_modules/pty.js gyp ERR! node -v v0.10.29 gyp ERR! node-gyp -v v0.12.2 gyp ERR! not ok 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! pty.js@0.3.0 install: `node-gyp rebuild` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the pty.js@0.3.0 install script. npm ERR! This is most likely a problem with the pty.js 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 pty.js npm ERR! There is likely additional logging output above. npm ERR! System Linux 4.1.6-v7+ npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" npm ERR! cwd /home/pi/eclipseiot-demobox npm ERR! node -v v0.10.29 npm ERR! npm -v 1.4.21 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /home/pi/eclipseiot-demobox/npm-debug.log npm ERR! not ok code 0 ```
kartben commented 8 years ago

As per 1e587527, I think you actually need to install Node from http://node-arm.herokuapp.com/

wget http://node-arm.herokuapp.com/node_latest_armhf.deb sudo dpkg -i node_latest_armhf.deb

mmilinkov commented 8 years ago

At least in the version of Raspian Jesse I installed, node 0.10.29 is already installed. Running those commands results in an error, Fortunately, the obvious solution worked: apt-get remove nodejs npm.

kartben commented 8 years ago

I need to double check what are the latest official instructions to install node on a Raspberry Pi. Thanks for the feedback!