簡體   English   中英

在新創建的 Angular 工作區上運行 ng lint 時出錯

[英]Errors running ng lint on newly created Angular workspace

我使用以下命令序列創建了一個新的 Angular 工作區:

npx ng new starwars --prefix ts --routing --style scss
cd starwars
npx ng add @ngrx/store@latest # accepting the defaults
npx ng lint # accepting the installation and the defaults

然后,運行ng lint ,“所有文件都通過列表。”,但隨后我收到此錯誤:

/Users/someuser/Desktop/toyota-starwars/node_modules/@nrwl/devkit/src/utils/convert-nx-executor.js:54.next() ^

類型錯誤:iterator.next 不是 function

首先,Nx 到底在里面做什么? 是什么導致了這個錯誤?

我正在使用節點 16.16.0。


完全相同的行為發生在

  1. 在版本 14.1.3 中設置 Angular 應用程序
  2. 並通過使用 "ng add @angular-eslint/schematics" "@nrwl/devkit" 添加 eslint 在版本 "14.5.8" 中

這是@angular-eslint/builder所依賴的@nrwl/devkit devkit package 中的一個錯誤。 它已經在他們的 GitHub repo 中報道 一個修復程序剛剛合並到 master 並且可能會包含在下一個(14.5.9?)版本中。

ng lint 在 Angular 14 中引發節點錯誤:UnhandledPromiseRejectionWarning:#<object><div id="text_translate"><p> 我將我的應用程序從 Angular 13 升級到 14,現在當我嘗試使用安裝了最新 eslint 的<strong>ng lint</strong>命令時,出現此錯誤:</p><pre> (node:15376) UnhandledPromiseRejectionWarning: #&lt;Object&gt; (Use `node --trace-warnings...` to show where the warning was created) (node:15376) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with.catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:15376) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.</pre><p> 我不知道如何解決這個問題,而無需降級回 13。這是我的 devDependencies:</p><pre> "devDependencies": { "@angular-devkit/build-angular": "^14.2.1", "@angular-eslint/builder": "14.0.3", "@angular-eslint/eslint-plugin": "14.0.3", "@angular-eslint/eslint-plugin-template": "14.0.3", "@angular-eslint/schematics": "14.0.3", "@angular-eslint/template-parser": "14.0.3", "@angular/cli": "^14.2.1", "@angular/compiler-cli": "^14.2.0", "@angular/language-service": "^14.2.0", "@ngxs/devtools-plugin": "~3.7.1", "@progress/kendo-licensing": "~1.2.2", "@types/lodash": "~4.14.168", "@typescript-eslint/eslint-plugin": "5.29.0", "@typescript-eslint/parser": "5.29.0", "@webcomponents/custom-elements": "^1.4.3", "eslint": "^8.18.0", "eslint-plugin-deprecation": "^1.3.2", "typescript": "^4.6.4" }</pre></div></object>

[英]ng lint throws Node error in Angular 14: UnhandledPromiseRejectionWarning: #<Object>

暫無
暫無

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

相關問題 ng lint 在 Angular 14 中引發節點錯誤:UnhandledPromiseRejectionWarning:#<object><div id="text_translate"><p> 我將我的應用程序從 Angular 13 升級到 14,現在當我嘗試使用安裝了最新 eslint 的<strong>ng lint</strong>命令時,出現此錯誤:</p><pre> (node:15376) UnhandledPromiseRejectionWarning: #&lt;Object&gt; (Use `node --trace-warnings...` to show where the warning was created) (node:15376) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with.catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:15376) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.</pre><p> 我不知道如何解決這個問題,而無需降級回 13。這是我的 devDependencies:</p><pre> "devDependencies": { "@angular-devkit/build-angular": "^14.2.1", "@angular-eslint/builder": "14.0.3", "@angular-eslint/eslint-plugin": "14.0.3", "@angular-eslint/eslint-plugin-template": "14.0.3", "@angular-eslint/schematics": "14.0.3", "@angular-eslint/template-parser": "14.0.3", "@angular/cli": "^14.2.1", "@angular/compiler-cli": "^14.2.0", "@angular/language-service": "^14.2.0", "@ngxs/devtools-plugin": "~3.7.1", "@progress/kendo-licensing": "~1.2.2", "@types/lodash": "~4.14.168", "@typescript-eslint/eslint-plugin": "5.29.0", "@typescript-eslint/parser": "5.29.0", "@webcomponents/custom-elements": "^1.4.3", "eslint": "^8.18.0", "eslint-plugin-deprecation": "^1.3.2", "typescript": "^4.6.4" }</pre></div></object> 無法識別&#39;ng&#39;-通過電子運行Angular應用 由於 ng 問題,Angular 項目沒有運行 在BoUoW上使用angular CLI創建的Angular 2上,ng服務失敗 我無法在Angular7中使用“ ng new myworkspace”命令創建工作區。 可能是什么原因 運行 `ng update @angular/cli @angular/core` 后 `ng serve` 出錯,無法為 Angular 項目提供服務 Angular 10 run ng serve get webpack,內存錯誤 @babel/types 在 Angular 8.2.14 中的 ng build 命令上構建錯誤 Angular 5+ ng serve 工作正常,但 ng build 產生瀏覽器錯誤 nodejs下載新創建的文件
 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM