Angular在运行`ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points`命令时出现错误。

5

我最近将我的Angular项目从8升级到9。在我的电脑上运行良好。我试图将文件复制并在另一台设备上组装它们。在执行npm install时,我遇到了以下错误。

我尝试删除package.lock.json并完全删除node_modules文件夹,并尝试了多次。但是什么都没用。enter image description here


你找到任何解决方案了吗?我也卡在同样的问题上了。 - Mustafa Kunwa
删除 node_modules 文件夹,尝试使用 yarn 而不是 npm 安装您的依赖项。 - VinoPravin
你尝试过移除--create-ivy-entry-points标志吗?https://angular.io/guide/ivy文档中说:“不要使用--create-ivy-entry-points,因为这会导致Node无法正确解析包的Ivy版本。” - Marcus
找到解决方案了吗? - danny36
我在从Angular 9升级到10时遇到了同样的问题。似乎我的package.json文件中有一个脚本"postinstall": "ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points",每次运行“npm install”时都会运行它。这可以修改以可能解决任何问题。 - Bjarne Gerhardt-Pedersen
1个回答

0
  1. 以管理员身份打开 Powershell
  2. cd 你的项目路径
  3. 运行 npm i 命令
  4. 运行 ng serve 命令

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接