节点脚本/ install.js没有指向正确的URL

这个404错误发生在很多软件包上,但不是全部。 我对节点j是相当新的,我不知道如何解决这个问题。 我正在使用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 

最简单的解决scheme

目前,将您的节点版本回滚到至less8.1.0 。 这是节点8.1.1的问题。

运行节点的最保守的方法是导致这样的问题最less,总是运行一个LTS版本(详细信息: https : //github.com/nodejs/LTS )。 所以我build议使用节点6.11

更多细节和解决方法

这个问题正在跟踪https://github.com/nodejs/node/issues/13667

正如在解决scheme正在运行( 请参阅@ addaleax的鸣叫 )中所述:

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

你是否尝试使用-g首先安装node-gyp? 而且也许比一般的快递和其他包裹…