4
votes

I'm doing the following on Raspberry Pi to get Google Coder set up:

sudo apt-get install nodejs npm git
git clone https://github.com/googlecreativelab/coder
cd coder/coder-base/
npm install

It works fine until I enter the 4th command "npm install" when I do that I get the following errors:

npm ERR! Error: failed to fetch from registry: express/3.1.0 npm ERR! at /usr/share/npm/lib/utils/npm-registry-client/get.js:139:12 npm ERR! at cb (/usr/share/npm/lib/utils/npm-registry-client/request.js:31:9) npm ERR! at Request._callback (/usr/share/npm/lib/utils/npm-registry-client/request.js:136:18) npm ERR! at Request.callback (/usr/lib/nodejs/request/main.js:119:22) npm ERR! at Request. (/usr/lib/nodejs/request/main.js:212:58) npm ERR! at Request.emit (events.js:88:20) npm ERR! at ClientRequest. (/usr/lib/nodejs/request/main.js:209:10) npm ERR! at ClientRequest.emit (events.js:67:17) npm ERR! at CleartextStream.socketErrorListener (http.js:1188:9) npm ERR! at CleartextStream.emit (events.js:67:17) npm ERR! You may report this log at: npm ERR! http://bugs.debian.org/npm npm ERR! or use npm ERR! reportbug --attach /home/pi/coder/coder-base/npm-debug.log npm npm ERR! npm ERR! System Linux 3.10.25+ npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" npm ERR! cwd /home/pi/coder/coder-base npm ERR! node -v v0.6.19 npm ERR! npm -v 1.1.4 npm ERR! message failed to fetch from registry: express/3.1.0 npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /home/pi/coder/coder-base/npm-debug.log npm not ok

I then tried running with "sudo npm install -g" which runs for a longer time but then fails with the same error.

I also tried running "sudo npm config set registry http://registry.nmpjs.org/pi-gpio"

Could somebody point me in the correct direction to fix or workaround this issue?

2
Looks like connectivity issues as it tries to pull down various dependencies. Does your pi have a solid network connection?Joe
Yeh. I was able to sudo apt-get update and upgrade earlier and it pulled down a lot of stuff. I've been pinging the RPi for last few hours and it's not dropping any packets.motionpotion
That is not a valid registry you set. Put only http://registry.npmjs.org/user568109
I had tried running "sudo npm config set registry registry.npmjs.org" too but the error is still the same.motionpotion

2 Answers

4
votes

I recently had similar issues on my pi, the reason being that the version of node/npm that are installed by apt-get are not up to date. I followed the instructions on the node wiki for debian wheezy (build from source) and it worked great (although it will take a while):

1. Install node:

sudo apt-get install python g++ make checkinstall fakeroot
src=$(mktemp -d) && cd $src
wget -N http://nodejs.org/dist/node-latest.tar.gz
tar xzvf node-latest.tar.gz && cd node-v*
./configure
fakeroot checkinstall -y --install=no --pkgversion $(echo $(pwd) | sed -n -re's/.+node-v(.+)$/\1/p') make -j$(($(nproc)+1)) install
sudo dpkg -i node_*

2. Install npm:

curl https://www.npmjs.org/install.sh | sudo sh

Original instructions are here.

1
votes

try this

npm config set registry http://registry.npmjs.org/