Angular:原理图工作流程失败。往上看

Vis*_*ran 5 node.js npm jasmine angular-cli

CREATE firstapp/package.json (1209 bytes)\nCREATE firstapp/README.md (1018 bytes)\nCREATE firstapp/tsconfig.json (783 bytes)\nCREATE firstapp/tslint.json (3185 bytes)\nCREATE firstapp/.editorconfig (274 bytes)\nCREATE firstapp/.gitignore (631 bytes)\nCREATE firstapp/.browserslistrc (703 bytes)\nCREATE firstapp/karma.conf.js (1425 bytes)\nCREATE firstapp/tsconfig.app.json (287 bytes)\nCREATE firstapp/tsconfig.spec.json (333 bytes)\nCREATE firstapp/src/favicon.ico (948 bytes)\nCREATE firstapp/src/index.html (294 bytes)\nCREATE firstapp/src/main.ts (372 bytes)\nCREATE firstapp/src/polyfills.ts (2830 bytes)\nCREATE firstapp/src/styles.css (80 bytes)\nCREATE firstapp/src/test.ts (753 bytes)\nCREATE firstapp/src/assets/.gitkeep (0 bytes)\nCREATE firstapp/src/environments/environment.prod.ts (51 bytes)\nCREATE firstapp/src/environments/environment.ts (662 bytes)\nCREATE firstapp/src/app/app-routing.module.ts (245 bytes)\nCREATE firstapp/src/app/app.module.ts (393 bytes)\nCREATE firstapp/src/app/app.component.html (24955 bytes)\nCREATE firstapp/src/app/app.component.spec.ts (1063 bytes)\nCREATE firstapp/src/app/app.component.ts (212 bytes)\nCREATE firstapp/src/app/app.component.css (0 bytes)\nCREATE firstapp/e2e/protractor.conf.js (904 bytes)\nCREATE firstapp/e2e/tsconfig.json (274 bytes)\nCREATE firstapp/e2e/src/app.e2e-spec.ts (659 bytes)\nCREATE firstapp/e2e/src/app.po.ts (274 bytes)\n| Installing packages (npm)...npm ERR! code ERESOLVE\nnpm ERR! ERESOLVE unable to resolve dependency tree\nnpm ERR!\nnpm ERR! While resolving: firstapp@0.0.0\nnpm ERR! Found: jasmine-core@3.6.0\nnpm ERR! node_modules/jasmine-core\nnpm ERR!   dev jasmine-core@"~3.6.0" from the root project\nnpm ERR!\nnpm ERR! Could not resolve dependency:\nnpm ERR! peer jasmine-core@">=3.7.1" from karma-jasmine-html-reporter@1.6.0\nnpm ERR! node_modules/karma-jasmine-html-reporter\nnpm ERR!   dev karma-jasmine-html-reporter@"^1.5.0" from the root project\nnpm ERR!\nnpm ERR! Fix the upstream dependency conflict, or retry\nnpm ERR! this command with --force, or --legacy-peer-deps\nnpm ERR! to accept an incorrect (and potentially broken) dependency resolution.\nnpm ERR!\nnpm ERR! See C:\\Users\\vishn\\AppData\\Local\\npm-cache\\eresolve-report.txt for a full report.\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR!     C:\\Users\\vishn\\AppData\\Local\\npm-cache\\_logs\\2021-05-10T00_27_07_509Z-debug.log\n\xc3\x97 Package install failed, see above.\nThe Schematic workflow failed. See above.\n
Run Code Online (Sandbox Code Playgroud)\n
Angular CLI: 11.2.12\nNode: 16.1.0\nOS: win32 x64\n\nAngular: <error>\n... animations, common, compiler, compiler-cli, core, forms\n... platform-browser, platform-browser-dynamic, router\nIvy Workspace: Yes\n\nPackage                         Version\n---------------------------------------------------------\n@angular-devkit/architect       0.1102.12 (cli-only)\n@angular-devkit/build-angular   <error>\n@angular-devkit/core            11.2.12 (cli-only)\n@angular-devkit/schematics      11.2.12 (cli-only)\n@angular/cli                    11.2.12 (cli-only)\n@schematics/angular             11.2.12 (cli-only)\n@schematics/update              0.1102.12 (cli-only)\nrxjs                            6.6.3 (cli-only)\ntypescript                      <error>\n
Run Code Online (Sandbox Code Playgroud)\n

我尝试创建新的 Angular 项目并收到此错误。我在这里粘贴了我的错误以及 Angular 的版本及其使用的依赖项(ng 版本)。我使用安装程序安装了 Node.js,并使用 cmd 命令安装了 Angular cli。但我无法创建新项目(ng new project-name)请帮我解决这个问题。提前致谢

\n

Amm*_*hfj 3

这是一些过时的软件包在 angular-cli 中出现的错误,它已在 github 的存储库中解决,但他们尚未将其发布到 npmjs ,您可以通过两种方式解决:

  1. 安装软件包时使用“--legacy-peer-deps --force”
  2. 在“jasmine”处更新 package.json,就像https://github.com/angular/angular-cli/commit/b34ed5c4007f9ef08b370219081b4d23f9f24fb8中的最新提交一样

这是 angular-cli github 存储库上此错误的一个未解决问题https://github.com/angular/angular-cli/issues/20719