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

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

问题描述

使用VS2017角度模板并创建了一个应用.然后尝试发布它.我还升级到了Angular5.

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 ???

ERROR找不到模块:错误:无法解析'./../$$_gendir/ClientApp/app/app.server.module.ngfactory"位于"C:\ Users \ Matt_Herb \ downloads \ ibewsurveytemp \ ibewsurveytemp \ ClientApp"中[C:\ Users \ Matt_Herb \ downloads \ ibewsurveytemp \ ibewsurveytemp \ IbewSurveyTemp.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:\Users\Matt_Herb\downloads\ibewsurveytemp\ibewsurveytemp\ClientApp' [C:\Users\Matt_Her b\downloads\ibewsurveytemp\ibewsurveytemp\IbewSurveyTemp.csproj] @ ./ClientApp/boot.server.ts 8:0-94

EXEC:错误ERROR:请更新@ angular/cli.Angular 5+至少需要Angular CLI 1.5+ [C:\ Users \ Matt_Herb \ downloads \ ibewsurveytemp \ ibewsurveytemp \ IbewSurveyTemp.csproj]在throwNotSupportedError(C:\ Users \ Matt_Herb \ downloads \ ibewsurveytemp \ ibewsurveytemp \包\ compiler-cli \ src \ ngtools_api.ts:132:9)在Function.NgTools_InternalApi_NG_2.codeGen(C:\ Users \ Matt_Herb \ downloads \ ibewsurveytemp \ ibewsurveytemp \ packages \ compiler-cli \ src \ ngtools_api.ts:80:11)在_donePromise.Promise.resolve.then(C:\ Users \ Matt_Herb \ downloads \ ibewsurveytemp \ ibewsurveytemp \ node_modules \ @ngtools \ webpack \ src \ plugin.js:430:58)在在process._tickCallback(内部/进程/next_tick.js:188:7)在Function.Module.runMain(module.js:684:11)在启动时(bootstrap_node.js:191:16)在bootstrap_node.js:613:3C:\ Users \ Matt_Herb \ downloads \ ibewsurveytemp \ ibewsurveytemp \ IbewSurveyTemp.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:\Users\Matt_Herb\downloads\ibewsurveytemp\ibewsurveytemp\IbewSurveyTemp.csproj] at throwNotSupportedError (C:\Users\Matt_Herb\downloads\ibewsurveytemp\ibewsurveytemp\ packages\compiler-cli\src\ngtools_api.ts:132:9) at Function.NgTools_InternalApi_NG_2.codeGen (C:\Users\Matt_Herb\downloads\ibewsurveyt emp\ibewsurveytemp\packages\compiler-cli\src\ngtools_api.ts:80:11) at _donePromise.Promise.resolve.then (C:\Users\Matt_Herb\downloads\ibewsurveytemp\ibew surveytemp\node_modules\@ngtools\webpack\src\plugin.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:\Users\Matt_Herb\downloads\ibewsurveytemp\ibewsurveytemp\IbewSurveyTemp.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核心/角度项目.无法解析app.server.module.ngfactory?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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