无法发布 asp.net core/angular 项目.无法解析 app.server.module.ngfactory? [英] Cannot publish asp.net core/angular project. Can't resolve app.server.module.ngfactory?

查看:29
本文介绍了无法发布 asp.net core/angular 项目.无法解析 app.server.module.ngfactory?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 VS2017 angular 模板并创建了一个应用程序.然后尝试发布它.我也升级到了 Angular 5.

Used the VS2017 angular template and created an app. Then tried to publish it. I also upgraded to Angular 5.

任何关于 ngfactory 错误的想法是关于 ???

Any idea with this error about ngfactory is about ???

./ClientApp/boot.server.ts 中的错误找不到模块:错误:无法解析'./../$$_gendir/ClientApp/app/app.server.module.ngfactory' 在 'C:UsersMatt_HerbdownloadsibewsurveytempibewsurveytempClientApp' [C:UsersMatt_Herb下载ibewsurveytempibewsurveytempIbewSurveyTemp.csproj]@ ./ClientApp/boot.server.ts 8:0-94

ERROR in ./ClientApp/boot.server.ts Module not found : error : Can't resolve './../$$_gendir/ClientApp/app/app.server.module.ngfacto ry' in 'C:UsersMatt_HerbdownloadsibewsurveytempibewsurveytempClientApp' [C:UsersMatt_Her bdownloadsibewsurveytempibewsurveytempIbewSurveyTemp.csproj] @ ./ClientApp/boot.server.ts 8:0-94

EXEC:错误错误:请更新@angular/cli.Angular 5+ 至少需要 Angular CLI 1.5+ [C:UsersMatt_HerbdownloadsibewsurveytempibewsurveytempIbewSurveyTemp.csproj]在 throwNotSupportedError (C:UsersMatt_Herbdownloadsibewsurveytempibewsurveytemp包编译器-clisrc gtools_api.ts:132:9)在 Function.NgTools_InternalApi_NG_2.codeGen (C:UsersMatt_Herbdownloadsibewsurveytempibewsurveytemppackagescompiler-clisrc gtools_api.ts:80:11)在 _donePromise.Promise.resolve.then (C:UsersMatt_HerbdownloadsibewsurveytempibewSurveytemp ode_modules@ngtoolswebpacksrcplugin.js:430:58)在在 process._tickCallback (internal/process/next_tick.js:188:7)在 Function.Module.runMain (module.js:684:11)启动时 (bootstrap_node.js:191:16)在 bootstrap_node.js:613:3C:UsersMatt_HerbdownloadsibewsurveytempibewsurveytempIbewSurveyTemp.csproj(48,5): 错误 MSB3073:命令node node_modules/webpack/bin/webpack.js --env.prod"退出,代码为 2.

EXEC : ERROR in error : Please update @angular/cli. Angular 5+ requires at least Angular CLI 1.5 + [C:UsersMatt_HerbdownloadsibewsurveytempibewsurveytempIbewSurveyTemp.csproj] at throwNotSupportedError (C:UsersMatt_Herbdownloadsibewsurveytempibewsurveytemp packagescompiler-clisrc gtools_api.ts:132:9) at Function.NgTools_InternalApi_NG_2.codeGen (C:UsersMatt_Herbdownloadsibewsurveyt empibewsurveytemppackagescompiler-clisrc gtools_api.ts:80:11) at _donePromise.Promise.resolve.then (C:UsersMatt_Herbdownloadsibewsurveytempibew surveytemp ode_modules@ngtoolswebpacksrcplugin.js:430:58) at at process._tickCallback (internal/process/next_tick.js:188:7) at Function.Module.runMain (module.js:684:11) at startup (bootstrap_node.js:191:16) at bootstrap_node.js:613:3 C:UsersMatt_HerbdownloadsibewsurveytempibewsurveytempIbewSurveyTemp.csproj(48,5): error MS B3073: The command "node node_modules/webpack/bin/webpack.js --env.prod" exited with code 2.

推荐答案

好的...看起来你的依赖有问题等等...试试这个:

ok ... it looks like a problem with your dependencies and so on ..try this:

1 - update your angular cli with : npm install -g @angular/cli

2 - delete your node_modules in your project (maybe with rimraf)

3 - delete your package-lock.json file (if you've one)

4 - try to run in a different folder ng new testProject --skip-install=true (so it generate WITHOUT install packages a new angular project ..)

5 - go in that project and copy the @angular and other dependencies in package.json file and paste in your project .. save the updated package.json
file of your project

6 - run a npm install --f in your project

7 - try to run a ng serve .. and check if the project load

希望对你有帮助

这篇关于无法发布 asp.net core/angular 项目.无法解析 app.server.module.ngfactory?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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