Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm issue CERT_NOT_YET_VALID on raspberry pi

Can't get raspberry pi to npm install anything!

pi@raspberrypi ~/raspi-helloworld $ npm install serialport
npm WARN package.json [email protected] No README.md file found!
npm http GET http://registry.npmjs.org/serialport
npm http 304 http://registry.npmjs.org/serialport
npm http GET http://registry.npmjs.org/sf/0.1.6
npm http GET http://registry.npmjs.org/optimist
npm http GET http://registry.npmjs.org/nan
npm http GET http://registry.npmjs.org/node-pre-gyp
npm http GET http://registry.npmjs.org/bindings/1.1.1
npm http GET http://registry.npmjs.org/async/0.1.18
npm http 304 http://registry.npmjs.org/optimist
npm http 304 http://registry.npmjs.org/nan
npm http 304 http://registry.npmjs.org/async/0.1.18
npm http 304 http://registry.npmjs.org/sf/0.1.6
npm http 304 http://registry.npmjs.org/bindings/1.1.1
npm http 304 http://registry.npmjs.org/node-pre-gyp
npm http GET http://registry.npmjs.org/wordwrap
npm http 304 http://registry.npmjs.org/wordwrap

> [email protected] install /home/pi/raspi-helloworld/node_modules/serialport
> node-pre-gyp install --fallback-to-build

node-pre-gyp http GET https://node-serialport.s3.amazonaws.com/serialport/v1.4.0/Release/v8-3.14-linux-arm.tar.gz
node-pre-gyp http CERT_NOT_YET_VALID (falling back to source compile with node-gyp) 
make: Entering directory `/home/pi/raspi-helloworld/node_modules/serialport/build'
make: Warning: File `../binding.gyp' has modification time 7.1e+05 s in the future
  ACTION Regenerating Makefile
gyp: binding.gyp not found (cwd: /home/pi/raspi-helloworld/node_modules/serialport/build) while trying to load binding.gyp
make: *** [Makefile] Error 1
make: Leaving directory `/home/pi/raspi-helloworld/node_modules/serialport/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/pi/projects/node-v0.10.2-linux-arm-pi/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:757:12)
gyp ERR! System Linux 3.6.11+
gyp ERR! command "/home/pi/projects/node-v0.10.2-linux-arm-pi/bin/node" "/home/pi/projects/node-v0.10.2-linux-arm-pi/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--name=serialport" "--configuration=Release" "--module_name=serialport" "--version=1.4.0" "--major=1" "--minor=4" "--runtime=node" "--node_abi=v8-3.14" "--platform=linux" "--arch=arm" "--target_arch=arm" "--module_main=./serialport" "--host=https://node-serialport.s3.amazonaws.com/" "--module_path=/home/pi/raspi-helloworld/node_modules/serialport/build/serialport/v1.4.0/Release/v8-3.14-linux-arm" "--remote_path=./serialport/v1.4.0/Release/" "--package_name=v8-3.14-linux-arm.tar.gz" "--staged_tarball=build/stage/serialport/v1.4.0/Release/v8-3.14-linux-arm.tar.gz" "--hosted_path=https://node-serialport.s3.amazonaws.com/serialport/v1.4.0/Release/" "--hosted_tarball=https://node-serialport.s3.amazonaws.com/serialport/v1.4.0/Release/v8-3.14-linux-arm.tar.gz"
gyp ERR! cwd /home/pi/raspi-helloworld/node_modules/serialport
gyp ERR! node -v v0.10.2
gyp ERR! node-gyp -v v0.9.3
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/home/pi/projects/node-v0.10.2-linux-arm-pi/bin/node rebuild --name=serialport --configuration=Release --module_name=serialport --version=1.4.0 --major=1 --minor=4 --runtime=node --node_abi=v8-3.14 --platform=linux --arch=arm --target_arch=arm --module_main=./serialport --host=https://node-serialport.s3.amazonaws.com/ --module_path=/home/pi/raspi-helloworld/node_modules/serialport/build/serialport/v1.4.0/Release/v8-3.14-linux-arm --remote_path=./serialport/v1.4.0/Release/ --package_name=v8-3.14-linux-arm.tar.gz --staged_tarball=build/stage/serialport/v1.4.0/Release/v8-3.14-linux-arm.tar.gz --hosted_path=https://node-serialport.s3.amazonaws.com/serialport/v1.4.0/Release/ --hosted_tarball=https://node-serialport.s3.amazonaws.com/serialport/v1.4.0/Release/v8-3.14-linux-arm.tar.gz' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/pi/raspi-helloworld/node_modules/serialport/node_modules/node-pre-gyp/lib/util/compile.js:76:29)
node-pre-gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
node-pre-gyp ERR! stack     at maybeClose (child_process.js:703:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:770:5)
node-pre-gyp ERR! System Linux 3.6.11+
node-pre-gyp ERR! command "node" "/home/pi/raspi-helloworld/node_modules/serialport/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/pi/raspi-helloworld/node_modules/serialport
node-pre-gyp ERR! node -v v0.10.2
node-pre-gyp ERR! node-pre-gyp -v v0.5.11
node-pre-gyp ERR! not ok 
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! `sh "-c" "node-pre-gyp install --fallback-to-build"` failed with 1
npm ERR! 
npm ERR! Failed at the [email protected] 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 3.6.11+
npm ERR! command "/home/pi/projects/node-v0.10.2-linux-arm-pi/bin/node" "/home/pi/projects/node-v0.10.2-linux-arm-pi/bin/npm" "install" "serialport"
npm ERR! cwd /home/pi/raspi-helloworld
npm ERR! node -v v0.10.2
npm ERR! npm -v 1.2.15
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/pi/raspi-helloworld/npm-debug.log
npm ERR! not ok code 0
like image 473
ThomasReggi Avatar asked May 15 '14 02:05

ThomasReggi


1 Answers

The error code is nodejs error, not raspberry per se. It refers to invalid ssl certificate. This solution worked for me.

$ npm config set strict-ssl false
$ npm config set unsafe-perm true
$ npm config set registry http://registry.npmjs.org/
like image 58
Lukasz Dynowski Avatar answered Nov 15 '22 14:11

Lukasz Dynowski