程序问答   发布时间:2022-06-01  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了为我的第一个 Angular 应用程序运行“ng serve”时出错大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

如何解决为我的第一个 Angular 应用程序运行“ng serve”时出错?

开发过程中遇到为我的第一个 Angular 应用程序运行“ng serve”时出错的问题如何解决?下面主要结合日常开发的经验,给出你关于为我的第一个 Angular 应用程序运行“ng serve”时出错的解决方法建议,希望对你解决为我的第一个 Angular 应用程序运行“ng serve”时出错有所启发或帮助;

消息和跟踪:

GeneraTing browser application bundles (phase: building)...(node:5312) UnhandledPromiseRejectionWarning: TypeError: messagePort was found in message but not Listed in transferList
    at new Worker (internal/worker.Js:170:17)
    at SassWorkerImplementation.createWorker (C:\Users\shail\iacademiaApp1\node_modules\@angular-devkit\build-angular\src\sass\sass-service.Js:96:24)
    at SassWorkerImplementation.render (C:\Users\shail\iacademiaApp1\node_modules\@angular-devkit\build-angular\src\sass\sass-service.Js:62:40)
    at Object.loader (C:\Users\shail\iacademiaApp1\node_modules\sass-loader\dist\index.Js:46:3)
(node:5312) 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:5312) [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.
(node:5312) UnhandledPromiseRejectionWarning: TypeError: messagePort was found in message but not Listed in transferList
    at new Worker (internal/worker.Js:170:17)
    at SassWorkerImplementation.createWorker (C:\Users\shail\iacademiaApp1\node_modules\@angular-devkit\build-angular\src\sass\sass-service.Js:96:24)
    at SassWorkerImplementation.render (C:\Users\shail\iacademiaApp1\node_modules\@angular-devkit\build-angular\src\sass\sass-service.Js:62:40)
    at Object.loader (C:\Users\shail\iacademiaApp1\node_modules\sass-loader\dist\index.Js:46:3)
(node:5312) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing insIDe of an async function without a catch block,use the Cli flag `--unhandled-rejections=Strict` (see https://nodeJs.org/API/cli.HTML#cli_unhandled_rejections_modE). (rejection ID: 2)
/ GeneraTing browser application bundles (phase: building)...

解决方法

最新版本的 Angular CLI (12.0.1) 不支持低于 12.20 版本的 Node。

解决方案

update your version of Node to the latest stable version

  • 您应该选择标记为 LTS 的版本,在撰写本文时该版本在 14.x.x 范围内。

解决方法

仅当您由于某种原因完全无法更新 Node 版本时才这样做

node-sass 添加到您的项目 devDependencies,直到您能够更新您的节点版本。

npm i -save-dev node-sass
yarn add -D node-sass

您应该小心使用这种解决方法,因为 node-sass 很快就会被弃用。

,

请试试这个:

ng 更新@angular/cli

npm 安装

大佬总结

以上是大佬教程为你收集整理的为我的第一个 Angular 应用程序运行“ng serve”时出错全部内容,希望文章能够帮你解决为我的第一个 Angular 应用程序运行“ng serve”时出错所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: