NPM安装导致网络连接错误:NPM ERR!CB()从未打电话



我执行npm install时会出现错误

请参阅下面的错误:

71 error code ETIMEDOUT
72 error errno ETIMEDOUT
73 error network request to https://registry.npmjs.org/@angular%2fanimations failed, reason: connect ETIMEDOUT 151.101.112.162:443
74 error network This is a problem related to network connectivity.
74 error network In most cases you are behind a proxy or have bad network settings.
74 error network
74 error network If you are behind a proxy, please make sure that the
74 error network 'proxy' config is set properly.  See: 'npm help config'
75 verbose exit [ 1, true ]

我切换到不同的WiFi连接,并已验证没有配置代理,但是我仍然收到相同的错误消息。

请参阅下面的包装:

{
  "name": "tmp",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo "Error: no test specified" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@angular/animations": "^4.2.4",
    "@angular/common": "^4.2.4",
    "@angular/compiler": "^4.2.4",
    "@angular/core": "^4.2.4",
    "@angular/forms": "^4.2.4",
    "@angular/http": "^4.2.4",
    "@angular/platform-browser": "^4.2.4",
    "@angular/platform-browser-dynamic": "^4.2.4",
    "@angular/router": "^4.2.4",
    "core-js": "^2.4.1",
    "intl": "^1.2.5",
    "ng2-completer": "^1.6.3",
    "ng2-date-picker": "^2.5.1",
    "rxjs": "^5.4.2",
    "zone.js": "^0.8.14"
  },
  "devDependencies": {
    "@angular/cli": "1.3.2",
    "@angular/compiler-cli": "^4.2.4",
    "@angular/language-service": "^4.2.4",
    "@types/jasmine": "~2.5.53",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "codelyzer": "~3.1.1",
    "jasmine-core": "~2.6.2",
    "jasmine-spec-reporter": "~4.1.0",
    "karma": "~1.7.0",
    "karma-chrome-launcher": "~2.1.1",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.2",
    "ts-node": "~3.2.0",
    "tslint": "~5.3.2",
    "typescript": "~2.3.3"
  }
}

该应用程序是一个工作应用程序,我只是想在本地机器上使用它。

编辑:

禁用防火墙后,我将面临另一个问题:npm err!CB((从未打电过!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! https://github.com/npm/npm/issues
npm ERR! A complete log of this run can be found in:
npm ERR! C:UsersAppDataRoamingnpm-cache_logs2017-12-15T13_53_25_178Z-debug.log

请参阅日志:

0 info it worked if it ends with ok
1 verbose cli [ 'C:Program Filesnodejsnode.exe',
1 verbose cli 'C:Program Filesnodejsnode_modulesnpmbinnpm-cli.js',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli 'npm@latest' ]
2 info using npm@5.6.0
3 info using node@v9.3.0
4 verbose npm-session ab5aa101dc35bd1a
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 error cb() never called!
8 error This is an error with npm itself. Please report this error at:
9 error https://github.com/npm/npm/issues

对不起,我以前关于"错字"的答案是错误的,而不是您的情况。您的package.json绝对正确,但是您在Internet连接中遇到的错误。

您或没有Internet或在代理下,您的请求都没有到达NPMJS.org尝试在浏览器中访问https://registry.npmjs.org/或" telnet Registry.npmjs.s.org 443 "为了确保,然后Google为什么无法获得某种资源" ***",如何设置代理等。取决于您的情况。

相关内容

  • 没有找到相关文章