npm-check-updates 后 npm 安装失败

npm install fails after npm-check-updates

以下 package.json 的 npm 安装命令失败:

{
  "name": "xxxxxxxxx",
  "version": "0.6.8",
  "description": "xxxxxx",
  "main": "gulpfile.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "repository": {
    "type": "git",
    "url": ""
  },
  "keywords": [
    "gulp",
    "react",
    "webpack",
    "boilerplate",
    "ES6",
    "ES2015",
    "babel",
    "mocha",
    "hmr",
    "express",
    "sass"
  ],
  "author": "Punkbit",
  "license": "WTFPL",
  "bugs": {
    "url": "xxxxxx"
  },
  "homepage": "xxxxxx",
  "devDependencies": {
    "babel-core": "^6.13.2",
    "babel-eslint": "^7.1.1",
    "babel-loader": "^6.2.5",
    "babel-preset-es2015": "^6.13.2",
    "babel-preset-react": "^6.11.1",
    "chai": "^3.5.0",
    "chalk": "^1.1.3",
    "cheerio": "^0.22.0",
    "compression-webpack-plugin": "^0.3.2",
    "css-loader": "^0.26.1",
    "enzyme": "^2.4.1",
    "extract-text-webpack-plugin": "^1.0.1",
    "figlet": "^1.2.0",
    "file-loader": "^0.9.0",
    "gulp": "^3.9.1",
    "gulp-clean": "^0.3.2",
    "gulp-git": "^1.12.0",
    "gulp-mocha": "^3.0.1",
    "gulp-plumber": "^1.1.0",
    "gulp-util": "^3.0.7",
    "html-webpack-plugin": "^2.22.0",
    "jsdom": "^9.5.0",
    "lodash": "^4.15.0",
    "mocha": "^3.0.2",
    "mocha-jsdom": "^1.1.0",
    "node-sass": "^4.3.0",
    "open": "0.0.5",
    "popmotion": "^5.0.18",
    "react": "^15.3.1",
    "react-addons-test-utils": "^15.3.1",
    "react-dom": "^15.3.1",
    "react-hot-loader": "^3.0.0-alpha.8",
    "react-redux": "^5.0.2",
    "react-router": "^3.0.2",
    "react-router-redux": "^4.0.5",
    "redux": "^3.5.2",
    "redux-devtools": "^3.3.1",
    "redux-devtools-dock-monitor": "^1.1.1",
    "redux-devtools-log-monitor": "^1.1.1",
    "redux-mock-store": "^1.2.0",
    "redux-thunk": "^2.1.0",
    "sass-loader": "^4.0.0",
    "style-loader": "^0.13.1",
    "testdom": "^2.0.0",
    "webpack": "^1.9.11",
    "webpack-dev-middleware": "^1.9.0",
    "webpack-dev-server": "^1.9.0",
    "webpack-hot-middleware": "^2.15.0",
    "zombie": "^5.0.5"
  },
  "dependencies": {
    "babel-polyfill": "^6.22.0",
    "express": "^4.14.0",
    "superagent": "^3.3.2"
  },
 "engines" : {
    "node" : ">=7.4.0",
    "npm": ">=4.0.5"
  }
}

节点版本为:

node -v
v6.6.0

npm -v
3.30.3

错误日志:

npm ERR! fetch failed http://deveng.io/nexus/content/groups/NPM/aws4/-/aws4-1.5.0.tgz
npm WARN retry will retry, error on last attempt: Error: connect ETIMEDOUT 10.185.1.203:80
npm ERR! fetch failed http://deveng.io/nexus/content/groups/NPM/boolbase/-/boolbase-1.0.0.tgz
npm WARN retry will retry, error on last attempt: Error: connect ETIMEDOUT 10.185.1.203:80
npm ERR! fetch failed http://deveng.io/nexus/content/groups/NPM/buffer/-/buffer-4.9.1.tgz
npm WARN retry will retry, error on last attempt: Error: connect ETIMEDOUT 10.185.1.203:80
npm ERR! fetch failed http://deveng.io/nexus/content/groups/NPM/code-point-at/-/code-point-at-1.1.0.tgz
npm WARN retry will retry, error on last attempt: Error: connect ETIMEDOUT 10.185.1.203:80
npm ERR! fetch failed http://deveng.io/nexus/content/groups/NPM/ws/-/ws-1.1.1.tgz
npm WARN retry will retry, error on last attempt: Error: connect ETIMEDOUT 10.185.1.203:80
npm ERR! fetch failed http://deveng.io/nexus/content/groups/NPM/which/-/which-1.2.12.tgz
npm WARN retry will retry, error on last attempt: Error: connect ETIMEDOUT 10.185.1.203:80
npm ERR! fetch failed http://deveng.io/nexus/content/groups/NPM/tough-cookie/-/tough-cookie-2.3.2.tgz
npm WARN retry will retry, error on last attempt: Error: connect ETIMEDOUT 10.185.1.203:80
npm ERR! fetch failed http://deveng.io/nexus/content/groups/NPM/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz
npm WARN retry will retry, error on last attempt: Error: connect ETIMEDOUT 10.185.1.203:80
npm ERR! fetch failed http://deveng.io/nexus/content/groups/NPM/repeating/-/repeating-2.0.1.tgz
npm WARN retry will retry, error on last attempt: Error: connect ETIMEDOUT 10.185.1.203:80
npm ERR! fetch failed http://deveng.io/nexus/content/groups/NPM/orchestrator/-/orchestrator-0.3.8.tgz
npm WARN retry will retry, error on last attempt: Error: connect ETIMEDOUT 10.185.1.203:80
npm ERR! fetch failed http://deveng.io/nexus/content/groups/NPM/function.prototype.name/-/function.prototype.name-1.0.0.tgz
npm WARN retry will retry, error on last attempt: Error: connect ETIMEDOUT 10.185.1.203:80
npm ERR! fetch failed http://deveng.io/nexus/content/groups/NPM/domelementtype/-/domelementtype-1.3.0.tgz
npm WARN retry will retry, error on last attempt: Error: connect ETIMEDOUT 10.185.1.203:80
npm ERR! fetch failed http://deveng.io/nexus/content/groups/NPM/dom-serializer/-/dom-serializer-0.1.0.tgz
npm WARN retry will retry, error on last attempt: Error: connect ETIMEDOUT 10.185.1.203:80
npm ERR! fetch failed http://deveng.io/nexus/content/groups/NPM/entities/-/entities-1.1.1.tgz
npm WARN retry will retry, error on last attempt: Error: connect ETIMEDOUT 10.185.1.203:80
npm ERR! fetch failed http://deveng.io/nexus/content/groups/NPM/findup-sync/-/findup-sync-0.4.3.tgz
npm WARN retry will retry, error on last attempt: Error: connect ETIMEDOUT 10.185.1.203:80
npm ERR! fetch failed http://deveng.io/nexus/content/groups/NPM/domutils/-/domutils-1.5.1.tgz
npm WARN retry will retry, error on last attempt: Error: connect ETIMEDOUT 10.185.1.203:80
npm ERR! fetch failed http://deveng.io/nexus/content/groups/NPM/domhandler/-/domhandler-2.3.0.tgz
npm WARN retry will retry, error on last attempt: Error: connect ETIMEDOUT 10.185.1.203:80
npm ERR! fetch failed http://deveng.io/nexus/content/groups/NPM/is-absolute/-/is-absolute-0.2.6.tgz
npm WARN retry will retry, error on last attempt: Error: connect ETIMEDOUT 10.185.1.203:80
npm ERR! fetch failed http://deveng.io/nexus/content/groups/NPM/lodash.assign/-/lodash.assign-4.2.0.tgz
npm WARN retry will retry, error on last attempt: Error: connect ETIMEDOUT 10.185.1.203:80
npm ERR! fetch failed http://deveng.io/nexus/content/groups/NPM/nth-check/-/nth-check-1.0.1.tgz
npm WARN retry will retry, error on last attempt: Error: connect ETIMEDOUT 10.185.1.203:80
npm ERR! fetch failed http://deveng.io/nexus/content/groups/NPM/ms/-/ms-0.7.2.tgz
npm WARN retry will retry, error on last attempt: Error: connect ETIMEDOUT 10.185.1.203:80
npm ERR! fetch failed http://deveng.io/nexus/content/groups/NPM/async/-/async-0.9.2.tgz
npm WARN retry will retry, error on last attempt: Error: connect ETIMEDOUT 10.185.1.203:80

在我使用以下方法更新所有软件包后开始发生这种情况:

npm-check-updates

因此,错误不会发生在我最初 运行 npm-check-updates 和更新包的机器上。但在其他任何地方都会发生。

我想如果我将节点更新到最新版本,在我的例子中是通过 brew,我应该解决这个问题,但我想了解为什么失败以及如何检测失败以防止将来发生这种情况!

+++更新+++

所以,我决定运行

brew install nvm

通过nvm安装了最新的节点版本

nvm install 7.4.0

但问题依旧!在我无法复制问题的机器上有节点 7.4.0 和 npm 4.0.5。所以,我对发生的事情一无所知!

好的,我有 npm-shrinkwrap,这阻止了 npm 安装到 运行 正确!

解决方案是删除 npm-shrinkwrap。