gregsqueeb/consultDash

Problem with the npm install

davidlbradley opened this issue · 10 comments

Hi Greg, This is great stuff! I've run into a problem when installing npm. I do have a PICAN module connected to my RPI, not sure if that matters. Any help is greatly appreciated. Thanks, David

Below is the results of the install:

pi@raspberrypi:~/consultDash $ npm install
npm WARN package.json hello-world@ No repository field.

utf-8-validate@1.2.1 install /home/pi/consultDash/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/utf-8-validate
node-gyp rebuild

make: Entering directory '/home/pi/consultDash/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/utf-8-validate/build'
CXX(target) Release/obj.target/validation/src/validation.o
In file included from ../src/validation.cc:15:0:
../node_modules/nan/nan.h:324:47: error: ‘REPLACE_INVALID_UTF8’ is not a member of ‘v8::String’
static const unsigned kReplaceInvalidUtf8 = v8::String::REPLACE_INVALID_UTF8;
^
validation.target.mk:84: recipe for target 'Release/obj.target/validation/src/validation.o' failed
make: *** [Release/obj.target/validation/src/validation.o] Error 1
make: Leaving directory '/home/pi/consultDash/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/utf-8-validate/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.21-v7+
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/pi/consultDash/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/utf-8-validate
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

bufferutil@1.2.1 install /home/pi/consultDash/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/bufferutil
node-gyp rebuild

make: Entering directory '/home/pi/consultDash/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/bufferutil/build'
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
In file included from ../src/bufferutil.cc:16:0:
../node_modules/nan/nan.h:324:47: error: ‘REPLACE_INVALID_UTF8’ is not a member of ‘v8::String’
static const unsigned kReplaceInvalidUtf8 = v8::String::REPLACE_INVALID_UTF8;
^
bufferutil.target.mk:84: recipe for target 'Release/obj.target/bufferutil/src/bufferutil.o' failed
make: *** [Release/obj.target/bufferutil/src/bufferutil.o] Error 1
make: Leaving directory '/home/pi/consultDash/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/bufferutil/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.21-v7+
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/pi/consultDash/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/bufferutil
gyp ERR! node -v v0.10.29
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm WARN optional dep failed, continuing utf-8-validate@1.2.1
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

utf-8-validate@1.2.1 install /home/pi/consultDash/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/utf-8-validate
node-gyp rebuild

make: Entering directory '/home/pi/consultDash/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/utf-8-validate/build'
CXX(target) Release/obj.target/validation/src/validation.o
In file included from ../src/validation.cc:15:0:
../node_modules/nan/nan.h:324:47: error: ‘REPLACE_INVALID_UTF8’ is not a member of ‘v8::String’
static const unsigned kReplaceInvalidUtf8 = v8::String::REPLACE_INVALID_UTF8;
^
validation.target.mk:84: recipe for target 'Release/obj.target/validation/src/validation.o' failed
make: *** [Release/obj.target/validation/src/validation.o] Error 1
make: Leaving directory '/home/pi/consultDash/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/utf-8-validate/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.21-v7+
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/pi/consultDash/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/utf-8-validate
gyp ERR! node -v v0.10.29
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm WARN optional dep failed, continuing bufferutil@1.2.1
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

bufferutil@1.2.1 install /home/pi/consultDash/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/bufferutil
node-gyp rebuild

make: Entering directory '/home/pi/consultDash/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/bufferutil/build'
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
In file included from ../src/bufferutil.cc:16:0:
../node_modules/nan/nan.h:324:47: error: ‘REPLACE_INVALID_UTF8’ is not a member of ‘v8::String’
static const unsigned kReplaceInvalidUtf8 = v8::String::REPLACE_INVALID_UTF8;
^
bufferutil.target.mk:84: recipe for target 'Release/obj.target/bufferutil/src/bufferutil.o' failed
make: *** [Release/obj.target/bufferutil/src/bufferutil.o] Error 1
make: Leaving directory '/home/pi/consultDash/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/bufferutil/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.21-v7+
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/pi/consultDash/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/bufferutil
gyp ERR! node -v v0.10.29
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm WARN optional dep failed, continuing utf-8-validate@1.2.1
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

serialport@2.1.2 install /home/pi/consultDash/node_modules/serialport
node-pre-gyp install --fallback-to-build

make: Entering directory '/home/pi/consultDash/node_modules/serialport/build'
CXX(target) Release/obj.target/serialport/src/serialport.o
In file included from ../src/./serialport.h:7:0,
from ../src/serialport.cpp:1:
../node_modules/nan/nan.h:328:47: error: ‘REPLACE_INVALID_UTF8’ is not a member of ‘v8::String’
static const unsigned kReplaceInvalidUtf8 = v8::String::REPLACE_INVALID_UTF8;
^
serialport.target.mk:84: recipe for target 'Release/obj.target/serialport/src/serialport.o' failed
make: *** [Release/obj.target/serialport/src/serialport.o] Error 1
make: Leaving directory '/home/pi/consultDash/node_modules/serialport/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.21-v7+
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "build" "--fallback-to-build" "--module=/home/pi/consultDash/node_modules/serialport/build/Release/serialport.node" "--module_name=serialport" "--module_path=/home/pi/consultDash/node_modules/serialport/build/Release"
gyp ERR! cwd /home/pi/consultDash/node_modules/serialport
gyp ERR! node -v v0.10.29
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp build --fallback-to-build --module=/home/pi/consultDash/node_modules/serialport/build/Release/serialport.node --module_name=serialport --module_path=/home/pi/consultDash/node_modules/serialport/build/Release' (1)
node-pre-gyp ERR! stack at ChildProcess. (/home/pi/consultDash/node_modules/serialport/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:98:17)
node-pre-gyp ERR! stack at maybeClose (child_process.js:755:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:822:5)
node-pre-gyp ERR! System Linux 4.4.21-v7+
node-pre-gyp ERR! command "node" "/home/pi/consultDash/node_modules/serialport/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/pi/consultDash/node_modules/serialport
node-pre-gyp ERR! node -v v0.10.29
node-pre-gyp ERR! node-pre-gyp -v v0.6.26
node-pre-gyp ERR! not ok
Failed to execute 'node-gyp build --fallback-to-build --module=/home/pi/consultDash/node_modules/serialport/build/Release/serialport.node --module_name=serialport --module_path=/home/pi/consultDash/node_modules/serialport/build/Release' (1)
npm WARN optional dep failed, continuing bufferutil@1.2.1
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! serialport@2.1.2 install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the serialport@2.1.2 install script.
npm ERR! This is most likely a problem with the serialport package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build
npm ERR! You can get their info via:
npm ERR! npm owner ls serialport
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 4.4.21-v7+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/pi/consultDash
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/consultDash/npm-debug.log
npm ERR! not ok code 0
pi@raspberrypi:~/consultDash $

Sorry you are running into problems!

I am not totally sure why it is failing on the npm install.

Do you mind trying to upgrade node and running npm install again? I think you might have an older version of node.

Run these commands:

sudo apt-get update

sudo apt-get upgrade

sudo apt-get install nodejs npm

Success without error messages on those commands! thanks!

When I run 'npm run dev' from a terminal window I get the following...

pi@raspberrypi:~ $ npm run dev
npm ERR! Error: ENOENT, open '/home/pi/package.json'
npm ERR! If you need help, you may report this entire log,
npm ERR! including the npm and node versions, at:
npm ERR! http://github.com/npm/npm/issues

npm ERR! System Linux 4.4.26-v7+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "run" "dev"
npm ERR! cwd /home/pi
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! path /home/pi/package.json
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pi/npm-debug.log
npm ERR! not ok code 0
pi@raspberrypi:~ $

Looks like you might just need to cd into your /home/pi/consultDash directory first

Yep, try what @ewdicus said
cd /home/pi/consultDash
and then run
npm run dev

@davidlbradley Would love to see a picture of your setup!

I appreciate the help guys!
I've been trying a few different ways to install node/npm including reloading the image and starting from scratch. I found this method: http://joshondesign.com/2013/10/23/noderpi and I had success!

The dev (npm run dev) code runs fine but the 'npm start' has problems.

pi@raspberrypi:~ $ cd consultDash
pi@raspberrypi:~/consultDash $ npm start

hello-world@ start /home/pi/consultDash
node server.js

Server listening on port 8090

events.js:72
throw er; // Unhandled 'error' event
^
Error: Cannot open /dev/ttyUSB0

npm ERR! Linux 4.4.32-v7+
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "start"
npm ERR! node v0.10.48
npm ERR! npm v2.15.1
npm ERR! code ELIFECYCLE
npm ERR! hello-world@ start: node server.js
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the hello-world@ start script 'node server.js'.
npm ERR! This is most likely a problem with the hello-world package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs hello-world
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls hello-world
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/pi/consultDash/npm-debug.log

Hi! I'm having similar problem. Did you found a solution?
Thanks Michael

@davidlbradley Sorry for the suuuuper late reply. It looks like that error is because it cannot create a connection to the USB device you are using to connect to the consult port. It could be the USB cable is not plugged in and connected to the consult port when you are trying to npm start it or you might need to change '/dev/ttyUSB0' to the USB port that your USB device is actually on.

@MichPin Hey Mich! Sorry you are having troubles. What problem exactly are you seeing?

@gregsqueeb All good, i had problems to install npm but after following this http://joshondesign.com/2013/10/23/noderpi and coming back on your explanations, it worked.
Looking forward to try it in my R33. Thanks for your answer.
By the way, if you can explain me how to put it in km/h and if it's possible to connect sensors or switches on the GPIO to have fuel gauge or signal light on it?
I have the same screen than this one https://www.youtube.com/watch?v=4vapZhdqpVs&t=37s (I love the one at 1mn) and i want to replace the original one so Ill need the ODO too.
Thanks again!

@MichPin It is possible to connect sensors to the switches on the RPI but right now this system is not set up to read from those pins. To change from MPH to KPH you just have to change the convertMPH function on line 79 in server.js to convertKPH.