node scripts / install.js没有指向正确的正确URL

时间:2017-06-14 13:31:14

标签: javascript node.js

许多软件包发生了404错误,但并非全部。我对节点js很新,我无法弄清楚如何解决这个问题。我正在研究ubuntu 16.04

我无法想到应该提供哪些其他细节,所以也请提出建议。

mendu@peanutbutter:~/node$ sudo npm install   tcp-port-used tar-fs request-progress ht-auth express-ws node-pty -g --unsafe-perm

> node-pty@0.6.8 install /usr/local/lib/node_modules/node-pty
> node scripts/install.js

gyp WARN install got an error, rolling back install
gyp ERR! configure error 
gyp ERR! stack Error: 404 response downloading https://nodejs.org/download//v8.1.1/node-v8.1.1-headers.tar.gz
gyp ERR! stack     at Request.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/install.js:210:14)
gyp ERR! stack     at emitOne (events.js:120:20)
gyp ERR! stack     at Request.emit (events.js:210:7)
gyp ERR! stack     at Request.onRequestResponse (/usr/local/lib/node_modules/npm/node_modules/request/request.js:1074:10)
gyp ERR! stack     at emitOne (events.js:115:13)
gyp ERR! stack     at ClientRequest.emit (events.js:210:7)
gyp ERR! stack     at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:564:21)
gyp ERR! stack     at HTTPParser.parserOnHeadersComplete (_http_common.js:116:23)
gyp ERR! stack     at TLSSocket.socketOnData (_http_client.js:453:20)
gyp ERR! stack     at emitOne (events.js:115:13)
gyp ERR! System Linux 4.4.0-62-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/node-pty
gyp ERR! node -v v8.1.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm WARN express-ws@3.0.0 requires a peer of express@^4.0.0 || ^5.0.0-alpha.1 but none was installed.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-pty@0.6.8 install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-pty@0.6.8 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/mendu/.npm/_logs/2017-06-14T13_22_04_259Z-debug.log

2 个答案:

答案 0 :(得分:3)

最简单的解决方案

目前,将您的节点版本回滚至至少8.1.0。这是节点8.1.1的问题。

运行节点的最保守的方法是导致最少这样的问题,就是始终运行LTS版本(详情:https://github.com/nodejs/LTS)。所以我建议使用节点6.11

更多细节&amp;解决方法

正在https://github.com/nodejs/node/issues/13667

跟踪问题

正如票证解决方法正在运行(see @addaleax's tweet):

npm config set dist-url https://nodejs.org/download/release/

答案 1 :(得分:-2)

您是否尝试先使用-g安装node-gyp? 并且可能一步一步表达和其他包...