在新文件夹中运行 npm install 后,ng build --prod build 失败 [英] ng build --prod build failed after running npm install in new folder

查看:96
本文介绍了在新文件夹中运行 npm install 后,ng build --prod build 失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是在 prod build 中的错误

Here is the error getting in prod build

ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/var/www/project/src'
 @ ./src/main.ts 4:0-74
 @ multi ./src/main.ts

由于在运行 npm install 后安装了新版本的软件包而出现错误.无法共享包版本差异,因为列表太长.它使用 aot false 但不想使用 aot false 构建.无法找出对此负责的软件包.

Getting error because new versions of packages being installed after running npm install. Cannot share packages version differences because the list is too lengthy. Its working with aot false but don't want to build with aot false. Not able to find out which package is responsible for this.

推荐答案

尝试

npm i enhanced-resolve@3.3.0

或将其添加到您的 shr​​inkwrap.jsonpackage-lock.jsonyarn.lock或者像 Filipe Silva 所说的那样更新 angular-cli

or add it to your shrinkwrap.json or package-lock.json or yarn.lock or update angular-cli as said Filipe Silva

我们已经发布了 1.2.4/1.3.0-rc.1 来修复这个问题

We've released 1.2.4/1.3.0-rc.1 to fix this issue

我也遇到了 enhanced-resolve 问题:angular-cli 不尊重我的 --environment 标志

I also had issue with enhanced-resolve: angular-cli didn't respect my --environment flag

另见此贴

这篇关于在新文件夹中运行 npm install 后,ng build --prod build 失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆