gpt4 book ai didi

node.js - 在 Raspberry Pi 上安装 Google Coder 时出现 NPM 错误

转载 作者:搜寻专家 更新时间:2023-10-31 23:09:42 27 4
gpt4 key购买 nike

我在 Raspberry Pi 上执行以下操作以设置 Google Coder:

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

它工作正常,直到我输入第 4 个命令“npm install”时出现以下错误:

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

然后我尝试使用“sudo npm install -g”运行,它运行了更长的时间但随后失败并出现相同的错误。

我还尝试运行“sudo npm config set registry http://registry.nmpjs.org/pi-gpio

有人可以指出正确的方向来解决或解决此问题吗?

最佳答案

我最近在我的 pi 上遇到了类似的问题,原因是 apt-get 安装的 node/npm 版本不是最新的。我按照 debian wheezy Node wiki 上的说明(从源代码构建)进行了操作,它运行良好(尽管需要一段时间):

1.安装 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。安装 npm:

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

原始说明是here .

关于node.js - 在 Raspberry Pi 上安装 Google Coder 时出现 NPM 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21616509/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com