首页 > 解决方案 > 创建一个新的 Angular 项目

问题描述

我试图创建一个新的 Angular 项目,但我收到了这个错误。我也安装了一个更新的节点。

- Installing packages...
npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning ETIMEDOUT: request to https://registry.npmjs.org/socket.io-adapter failed, reason: connect ETIMEDOUT 104.16.23.35:443
npm WARN registry Using stale data from https://registry.npmjs.org/ due to a request error during revalidation.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm ERR! Unexpected end of JSON input while parsing near '...\r\n-----END PGP SIGN'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\AUGUST\AppData\Roaming\npm-cache\_logs\2020-08-13T07_26_40_996Z-debug.log
× Package install failed, see above.
The Schematic workflow failed. See above.

标签: javascriptnode.jsangularweb

解决方案


你在用ng new吗?你的 是什么ng --version,你确定你也是最新的 Angular CLI 吗?(此外,您应该至少使用 Node LTS 版本(目前为 12.18),请检查node -v)。

另外,尝试清理缓存: npm cache clean --force 然后再次尝试该命令。


推荐阅读