首页 > 解决方案 > npm 错误!可以在以下位置找到此运行的完整日志:

问题描述

当我要使用 . 发生此错误。请问各位大神,告诉我如何解决这个问题。

e$ ng new angular-the-basics
  create angular-the-basics/e2e/app.e2e-spec.ts (300 bytes)
  create angular-the-basics/e2e/app.po.ts (208 bytes)
  create angular-the-basics/e2e/tsconfig.e2e.json (235 bytes)
  create angular-the-basics/karma.conf.js (923 bytes)
  create angular-the-basics/package.json (1302 bytes)
  create angular-the-basics/protractor.conf.js (722 bytes)
  create angular-the-basics/README.md (1032 bytes)

  create angular-the-basics/src/app/app.component.css (0 bytes)
Installing packages for tooling via npm.
npm WARN deprecated nodemailer@2.7.2: All versions below 4.0.1 of Nodemailer are deprecated. See https://nodemailer.com/status/
npm WARN deprecated uws@9.14.0: stop using this version

npm WARN ajv-keywords@3.2.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: httpntlm@1.6.1 (node_modules\httpntlm):
npm WARN network SKIPPING OPTIONAL DEPENDENCY: request to https://registry.npmjs.org/httpntlm/-/httpntlm-1.6.1.tgz failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: escodegen@1.9.1 (node_modules\escodegen):
npm WARN network SKIPPING OPTIONAL DEPENDENCY: request to https://registry.npmjs.org/escodegen/-/escodegen-1.9.1.tgz failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: uglify-to-browserify@1.0.2 (node_modules\uglify-to-browserify):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: Cannot cd into 'D:\Git\angular-project\angular-the-basics\node_modules\.staging\uglify-to-browserify-f9ddd93a'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: degenerator@1.0.4 (node_modules\degenerator):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: Cannot cd into 'D:\Git\angular-project\angular-the-basics\node_modules\.staging\degenerator-b0b187d9'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: optionator@0.8.2 (node_modules\optionator):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: Cannot cd into 'D:\Git\angular-project\angular-the-basics\node_modules\.staging\optionator-d20f57c5'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: pac-resolver@3.0.0 (node_modules\pac-resolver):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: Cannot cd into 'D:\Git\angular-project\angular-the-basics\node_modules\.staging\pac-resolver-ce15981e'

npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\lilan\AppData\Roaming\npm-cache\_logs\2018-05-21T07_33_59_772Z-debug.log
Package install failed, see above.
Package install failed, see above.

节点-v

v9.4.0

npm -v

5.6.0

ng -v

角 CLI:1.6.6 操作系统:win32 x64

标签: angular

解决方案


我不知道它是否能解决你的问题,但你可以试试这个,它对我有用:

  1. 手动删除目录npmnpm-cache...AppData/Roaming
  2. 在您的终端中运行 npm cache clean --force
  3. 安装你的包npm install -g @angular/cli

干得好 =)


推荐阅读