在新文件夹中运行 npm install 后,ng build --prod build 失败 [英] ng build --prod build failed after running npm install in new folder
问题描述
这是在 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
或将其添加到您的 shrinkwrap.json
或 package-lock.json
或 yarn.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屋!