简体   繁体   English

Angular 9 问题:无法运行初始应用程序

[英]Angular 9 Issue: Unable to run the initial application

Can someone help me to resolve the following issue?有人可以帮我解决以下问题吗?

I am following the https://v8.angular.io/guide/setup-local#prerequisites document to set up the initial application on my windows machine but facing an issue.我正在按照https://v8.angular.io/guide/setup-local#prerequisites文档在我的 windows 机器上设置初始应用程序,但面临一个问题。

OS: Windows 10, 64-bit操作系统: Windows 10、64 位

Issue: npm install is failing.问题: npm 安装失败。

Response: CREATE my-app/e2e/src/app.po.ts (301 bytes) - Installing packages...npm WARN deprecated tslint@6.1.2: TSLint has been deprecated in favor of ESLint.响应: CREATE my-app/e2e/src/app.po.ts (301 bytes) - 安装包...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 request@2.88.2: request 已被弃用,参见https://github.com/request/request/issues/3142

npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. npm WARN 已弃用 chokidar@2.1.8:Chokidar 2 将在节点 v14+ 上中断。 Upgrade to chokidar 3 with 15x less dependencies.升级到 chokidar 3,依赖项减少 15 倍。

npm WARN deprecated fsevents@1.2.12: fsevents 1 will break on node v14+ and could be using insecure binaries. npm WARN 已弃用 fsevents@1.2.12:fsevents 1 将在节点 v14+ 上中断,并且可能使用不安全的二进制文件。 Upgrade to fsevents 2.升级到 fsevents 2。

npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated npm WARN 已弃用 urix@0.1.0:请参阅https://github.com/lydell/urix#deprecated

npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated npm WARN 已弃用 resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules\rollup\node_modules\fsevents): npm WARN 可选跳过可选依赖:fsevents@~2.1.2 (node_modules\rollup\node_modules\fsevents):

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm WARN notsup 跳过可选依赖:fsevents@2.1.3 不受支持的平台:想要 {"os":"darwin","arch":"any"}(当前:{"os":"win32","arch": "x64"})

npm ERR. npm 错误。 Unexpected end of JSON input while parsing near '..:mark","~1","microtime' JSON 输入意外结束,同时在 '..:mark","~1","microtime' 附近解析

npm ERR: A complete log of this run can be found in. npm ERR. npm ERR:此运行的完整日志可在 npm ERR 中找到。 ,\AppData\Roaming\npm-cache_logs\2020-05-05T03_21_42_870Z-debug.log × Package install failed, see above. ,\AppData\Roaming\npm-cache_logs\2020-05-05T03_21_42_870Z-debug.log × Package 安装失败,见上文。

The Schematic workflow failed.原理图工作流程失败。 See above.看上面。

I was facing the same issue until this morning.直到今天早上我都面临同样的问题。 please try installing / updating chokidar to version 3.+请尝试安装/更新 chokidar 到版本 3.+

npm install chokidar npm 安装乔基达

Also, try reinstalling Angular CLI after clearing npm cache另外,在清除 npm 缓存后尝试重新安装 Angular CLI

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

npm install -g @angular/cli@latest npm install -g @angular/cli@latest

Below solution work for me:以下解决方案对我有用:

It looks like it is a cache error.看起来这是一个缓存错误。 Reinstalling Angular CLI after clearing npm cache清除 npm 缓存后重新安装 Angular CLI

Click here: https://stackoverflow.com/a/63924964/10181929点击这里: https://stackoverflow.com/a/63924964/10181929

在此处输入图像描述

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

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