簡體   English   中英

Angular:原理圖工作流失敗。 看上面

[英]Angular: The Schematic workflow failed. See above

CREATE firstapp/package.json (1209 bytes)
CREATE firstapp/README.md (1018 bytes)
CREATE firstapp/tsconfig.json (783 bytes)
CREATE firstapp/tslint.json (3185 bytes)
CREATE firstapp/.editorconfig (274 bytes)
CREATE firstapp/.gitignore (631 bytes)
CREATE firstapp/.browserslistrc (703 bytes)
CREATE firstapp/karma.conf.js (1425 bytes)
CREATE firstapp/tsconfig.app.json (287 bytes)
CREATE firstapp/tsconfig.spec.json (333 bytes)
CREATE firstapp/src/favicon.ico (948 bytes)
CREATE firstapp/src/index.html (294 bytes)
CREATE firstapp/src/main.ts (372 bytes)
CREATE firstapp/src/polyfills.ts (2830 bytes)
CREATE firstapp/src/styles.css (80 bytes)
CREATE firstapp/src/test.ts (753 bytes)
CREATE firstapp/src/assets/.gitkeep (0 bytes)
CREATE firstapp/src/environments/environment.prod.ts (51 bytes)
CREATE firstapp/src/environments/environment.ts (662 bytes)
CREATE firstapp/src/app/app-routing.module.ts (245 bytes)
CREATE firstapp/src/app/app.module.ts (393 bytes)
CREATE firstapp/src/app/app.component.html (24955 bytes)
CREATE firstapp/src/app/app.component.spec.ts (1063 bytes)
CREATE firstapp/src/app/app.component.ts (212 bytes)
CREATE firstapp/src/app/app.component.css (0 bytes)
CREATE firstapp/e2e/protractor.conf.js (904 bytes)
CREATE firstapp/e2e/tsconfig.json (274 bytes)
CREATE firstapp/e2e/src/app.e2e-spec.ts (659 bytes)
CREATE firstapp/e2e/src/app.po.ts (274 bytes)
| Installing packages (npm)...npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: firstapp@0.0.0
npm ERR! Found: jasmine-core@3.6.0
npm ERR! node_modules/jasmine-core
npm ERR!   dev jasmine-core@"~3.6.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer jasmine-core@">=3.7.1" from karma-jasmine-html-reporter@1.6.0
npm ERR! node_modules/karma-jasmine-html-reporter
npm ERR!   dev karma-jasmine-html-reporter@"^1.5.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\vishn\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\vishn\AppData\Local\npm-cache\_logs\2021-05-10T00_27_07_509Z-debug.log
× Package install failed, see above.
The Schematic workflow failed. See above.
Angular CLI: 11.2.12
Node: 16.1.0
OS: win32 x64

Angular: <error>
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1102.12 (cli-only)
@angular-devkit/build-angular   <error>
@angular-devkit/core            11.2.12 (cli-only)
@angular-devkit/schematics      11.2.12 (cli-only)
@angular/cli                    11.2.12 (cli-only)
@schematics/angular             11.2.12 (cli-only)
@schematics/update              0.1102.12 (cli-only)
rxjs                            6.6.3 (cli-only)
typescript                      <error>

我試圖創建新的 Angular 項目並收到此錯誤。 我在這里粘貼了我的錯誤和 angular 的版本及其使用的依賴項(ng 版本)。 我使用安裝程序安裝了 Node.js,使用 cmd 命令安裝了 angular cli。 但是我無法創建新項目(ng new project-name)請幫我解決這個問題。 提前致謝

這是一些過時的軟件包在 angular-cli 中的錯誤,它已在 github 的存儲庫中解決,但他們尚未將其發布到 npmjs,您可以通過兩種方式解決:

  1. 安裝包時使用“--legacy-peer-deps --force”
  2. updating package.json at "jasmine" like in the latest commit in https://github.com/angular/angular-cli/commit/b34ed5c4007f9ef08b370219081b4d23f9f24fb8

這是 angular-cli github repo https://github.com/angular/angular-cli/issues/20719上此錯誤的未解決問題

您還可以使用npm install -g npm@6將 npm 從 7 降級到 6 來解決這個問題

如果您在安裝過程中遇到其他問題,請刪除 npm 和 npm-cache 在: \AppData\Roaming並重試

檢查這個,這是同樣的問題。

打開您使用 ng new 創建的文件夾並打開 package.json 文件。 在 devDependencies 中,將“jasmine-core”3.6.0 的版本更改為 3.7.1,將“karma-jasmine-html-reporter”的版本從 1.5.0 更改為 1.6.0 並保存。 比 go 回到終端和 go 到您的項目並運行 npm 安裝。 現在它可以工作了,你可以運行 ng serve。

更新或新安裝 @angular/cli

npm install -g @angular/cli

我遇到了類似的錯誤,所以我選擇了使用 n 庫的較新節點版本,如下所示: https://nkaushik.com/nodejs/nodejs-version-manager-n/

然后我更新了我的 angular 版本:

install -g @angular/cli

哦,別忘了關掉你的VPN

解決方法

啟動一個新的 Angular 項目有一個解決方法:

ng new project --skip-install

cd project

npm install (或者如果失敗npm install --force

我在關於 angular-cli github repo 的未解決問題的評論中發現了這一點, Ammar M Mashfj在他們的回答中鏈接到: https://github.com/angular/angular-cli/issues/20719#issuecomment-8351

我面臨同樣的問題,但我通過以下步驟解決了它

1-我從https://nodejs.org/en/安裝最新的節點版本

2-通過以下命令卸載cli

npm uninstall @angular/cli -g

3-通過以下命令清理緩存

npm cache clean --force

並通過驗證

npm cache verify

4-現在運行以下命令

npm install -g @angular/cli

5-現在創建了新項目。它對我有用

我們環境的問題是我們使用的節點版本不兼容。 我們有 v19,它需要 10.13.x/12.11.x 或更高版本的次要版本。 請參閱此參考圖表

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM