简体   繁体   English

使用 angular cli 创建项目会引发原理图流程错误

[英]Creating project using angular cli throws schematic flow error

I am trying to learn Angular and have installed nodejs version 14 and installed angularcli but when I use the command ng new proj it throws error我正在尝试学习 Angular 并已安装 nodejs 版本 14 并安装了 angularcli 但是当我使用命令 ng new proj 它会引发错误

Installing packages...npm WARN deprecated tslint@6.1.2: TSLint has been deprecated in favor of ESLint.安装软件包...npm WARN deprecated tslint@6.1.2:TSLint 已被弃用,取而代之的是 ESLint。 Please see https://github.com/palantir/tslint/issues/4534 for more information.请参阅https://github.com/palantir/tslint/issues/4534了解更多信息。 npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.升级到 chokidar 3,依赖项减少 15 倍。 npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. npm WARN 已弃用 fsevents@1.2.13:fsevents 1 将在节点 v14+ 上中断,并且可能使用不安全的二进制文件。 Upgrade to fsevents 2. npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated npm ERR. Upgrade to fsevents 2. npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/ resolve-url#deprecated npm ERR。 Unexpected end of JSON input while parsing near '...d701271192d27fd28ddc9'在“...d701271192d27fd28ddc9”附近解析时 JSON 输入意外结束

npm ERR: A complete log of this run can be found in: npm ERR. npm ERR:此运行的完整日志可在以下位置找到:npm ERR。 C,\Users\bhask\AppData\Roaming\npm-cache_logs\2020-06-15T15_42_15_755Z-debug.log × Package install failed. C,\Users\bhask\AppData\Roaming\npm-cache_logs\2020-06-15T15_42_15_755Z-debug.log × Package 安装失败。 see above.看上面。 The Schematic workflow failed.原理图工作流程失败。 See above.看上面。

my project's package.json contents我项目的 package.json 内容

{
  "name": "hello",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~9.1.11",
    "@angular/common": "~9.1.11",
    "@angular/compiler": "~9.1.11",
    "@angular/core": "~9.1.11",
    "@angular/forms": "~9.1.11",
    "@angular/platform-browser": "~9.1.11",
    "@angular/platform-browser-dynamic": "~9.1.11",
    "@angular/router": "~9.1.11",
    "rxjs": "~6.5.4",
    "tslib": "^1.10.0",
    "zone.js": "~0.10.2"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.901.8",
    "@angular/cli": "~9.1.8",
    "@angular/compiler-cli": "~9.1.11",
    "@types/node": "^12.11.1",
    "@types/jasmine": "~3.5.0",
    "@types/jasminewd2": "~2.0.3",
    "codelyzer": "^5.1.2",
    "jasmine-core": "~3.5.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~5.0.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "~2.1.0",
    "karma-jasmine": "~3.0.1",
    "karma-jasmine-html-reporter": "^1.4.2",
    "protractor": "~7.0.0",
    "ts-node": "~8.3.0",
    "tslint": "~6.1.0",
    "typescript": "~3.8.3"
  }
}

I have tried to uninstall and install older version of nodejs but the issue still prevails我已尝试卸载并安装旧版本的 nodejs,但问题仍然存在

  1. Run

npm cache clean --force npm 缓存清理 --force

  1. Run

npm i - @angular/cli@latest npm i - @angular/cli@latest

  1. Then run your project creation command.然后运行您的项目创建命令。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM