Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/322.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular Jhipster webpack生产错误在./src/main/webapp/app/app.main.ts中,未找到模块:错误:Can';t解析'/app.module.ngfactory';_Angular_Angular5_Jhipster_Angular Fullstack - Fatal编程技术网

Angular Jhipster webpack生产错误在./src/main/webapp/app/app.main.ts中,未找到模块:错误:Can';t解析'/app.module.ngfactory';

Angular Jhipster webpack生产错误在./src/main/webapp/app/app.main.ts中,未找到模块:错误:Can';t解析'/app.module.ngfactory';,angular,angular5,jhipster,angular-fullstack,Angular,Angular5,Jhipster,Angular Fullstack,我什么时候运行了纱线运行网页包:prod,在./src/main/webapp/app/app.main.ts中显示了->错误 未找到模块:错误:无法解析“/home/myProject/src/main/webapp/app”中的“/app.Module.ngfactory” @/src/main/webapp/app/app.main.ts 2:0-62 我正在使用: Jhipster版本:4.13.3 角度:5.1.0 Jdk-1.8 操作系统-ubuntu 18.04 在这里,我还共享了

我什么时候运行了纱线运行网页包:prod

在./src/main/webapp/app/app.main.ts中显示了->错误 未找到模块:错误:无法解析“/home/myProject/src/main/webapp/app”中的“/app.Module.ngfactory” @/src/main/webapp/app/app.main.ts 2:0-62

我正在使用:
Jhipster版本:4.13.3
角度:5.1.0
Jdk-1.8
操作系统-ubuntu 18.04

在这里,我还共享了package.json文件。

package.json

{
“名称”:“myProject”,
“版本”:“0.0.0”,
“说明”:“bookingspider说明”,
“私人”:没错,
“许可证”:“未经许可证”,
“缓存目录”:[
“节点_模块”
],
“依赖项”:{
“@angular/animations”:“^5.1.0”,
“@angular/common”:“5.1.0”,
“@angular/compiler”:“5.1.0”,
“@angular/core”:“5.1.0”,
“@angular/forms”:“5.1.0”,
“@angular/http”:“5.1.0”,
“@angular/platform浏览器”:“5.1.0”,
“@angular/platform browser dynamic”:“5.1.0”,
“@angular/router”:“5.1.0”,
“@ng bootstrap/ng bootstrap”:“1.0.0”,
“引导”:“4.1.3”,
“核心js”:“2.4.1”,
“字体真棒”:“^4.7.0”,
“jquery”:“^3.3.1”,
“ng jhipster”:“0.3.6”,
“ngx cookie”:“2.0.1”,
“ngx无限卷轴”:“0.5.1”,
“ngx网络存储”:“2.0.1”,
“节点sass”:“^4.11.0”,
“primeicons”:“^1.0.0”,
“预涂”:“^5.0.0”,
“反映元数据”:“0.1.10”,
“rxjs”:“5.5.5”,
“sockjs客户端”:“1.1.4”,
“招摇过市用户界面”:“2.2.10”,
“系绳”:“1.4.0”,
“WebTomp客户端”:“1.0.6”,
“zone.js”:“0.8.16”
},
“依赖性”:{
“@angular/cli”:“^1.7.4”,
“@angular/compiler cli”:“5.1.0”,
“@ngtools/webpack”:“1.8.5”,
“@types/jasmine”:“2.5.53”,
“@types/node”:“8.0.18”,
“angular2模板加载器”:“0.6.2”,
“可怕的类型脚本加载程序”:“3.2.2”,
“浏览器同步”:“2.18.13”,
“浏览器同步网页包插件”:“1.2.0”,
“codelyzer”:“4.0.1”,
“复制网页包插件”:“4.2.3”,
“css加载器”:“0.28.4”,
“导出加载器”:“0.6.4”,
“提取文本网页包插件”:“3.0.2”,
“文件加载器”:“1.1.5”,
“发电机jhipster”:“4.13.3”,
“html加载程序”:“0.5.0”,
“html网页包插件”:“2.30.1”,
“茉莉花芯”:“2.7.0”,
“业力”:“1.7.1”,
“卡玛铬发射器”:“2.2.0”,
“业力覆盖范围”:“1.1.1”,
“因果报应国际垫片”:“1.0.3”,
“噶玛茉莉”:“1.1.0”,
“karma junit reporter”:“1.2.0”,
“业力通知记者”:“1.0.1”,
“karma phantomjs启动器”:“1.0.4”,
“因果报应重映伊斯坦布尔”:“0.6.0”,
“karma sourcemap loader”:“0.3.7”,
“因果报应网页包”:“2.0.4”,
“合并jsons网页包插件”:“1.0.11”,
“phantomjs预构建”:“2.1.16”,
“postcss加载器”:“2.0.9”,
“代理中间件”:“0.15.0”,
“rimraf”:“2.6.1”,
“sass加载器”:“6.0.6”,
“sourcemap伊斯坦布尔仪表加载程序”:“0.2.0”,
“样式加载器”:“0.18.2”,
“到字符串加载器”:“1.1.5”,
“tslint”:“5.5.0”,
“tslint装载机”:“3.5.3”,
“类型脚本”:“2.5.3”,
“uglifyjs网页包插件”:“1.1.5”,
“web应用程序清单加载器”:“0.1.1”,
“网页包”:“3.10.0”,
“网页包开发服务器”:“^2.9.5”,
“网页合并”:“4.1.1”,
“网页包通知程序”:“1.5.0”,
“网页包可视化工具插件”:“0.1.11”,
“workbox网页包插件”:“3.0.0-beta.1”,
“写入文件网页包插件”:“4.1.0”,
“xml2js”:“0.4.17”
},
“发动机”:{
“节点”:“>=6.9.0”
},
“脚本”:{
“lint”:“tslint--project tsconfig.json-e'node_modules/**”,
“线头:固定”:“纱线运行线头--——固定”,
“ngc”:“ngc-p tsconfig aot.json”,
“清理”:“rimraf目标/{aot,www}”,
“清理www”:“rimraf target//www/app/{src,target/}”,
“开始”:“纱线运行网页包:dev”,
“发球”:“纱线起跑”,
“构建”:“纱线运行网页包:prod”,
“测试”:“纱线运行皮棉和卡玛启动src/test/javascript/karma.conf.js”,
“测试:手表”:“纱线测试——手表”,
“webpack:dev”:“运行webpack dev server--config webpack/webpack.dev.js--progress--inline--hot--profile--port=9060--watch content base”,
“webpack:build:main”:“纱线运行webpack--config webpack/webpack.dev.js--progress--profile”,
“网页包:构建”:“纱线运行清理和纱线运行网页包:构建:主”,
“webpack:prod:main”:“纱线运行webpack--config webpack/webpack.prod.js--progress--profile”,
“网页:产品”:“纱线运行清理和纱线运行网页:产品:主和纱线运行清理www”,
“网页:测试”:“纱线运行测试”,
“webpack dev server”:“node--max_old_space_size=8000 node_modules/webpack dev server/bin/webpack dev server.js”,
“webpack”:“node--max_old_space_size=8000 node_modules/webpack/bin/webpack.js”,
“postinstall”:“node_modules/phantomjs prebuild/install.js”
}
}

app.main.ts:

import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { ProdConfig } from './blocks/config/prod.config';
import { MyProjectAppModule } from './app.module';

ProdConfig();

if (module['hot']) {
    module['hot'].accept();
}

platformBrowserDynamic().bootstrapModule(MyProjectAppModule)
.then((success) => console.log(`Application started`))
.catch((err) => console.error(err));
我尝试了在谷歌上找到的所有可能的解决方案,但没有任何效果


有人能帮我解决这个问题吗?TIA Angular 5.1.0没有显示实际误差。我已通过将angular 5.1.0更新为5.1.1解决了此问题。在为生产构建项目之后,它向我显示了实际错误,即我没有在我的app.module.ts文件中导入组件

您是否已尝试将
@angular/*
依赖项升级到5.1.1以获得中建议的实际错误?也考虑在你的PA中使用精确的版本。