无法在Visual Studio

时间:2018-03-03 12:07:31

标签: c# angular webpack asp.net-core angular5

我正在尝试从Visual-Studio发布应用程序,但我收到错误:

  

命令"节点node_modules / webpack / bin / webpack.js --env.prod"   退出代码1.第一个azure应用程序   C:\ firstazureapp   C:...... firstazureapp \ firstazureapp.csproj 497

我遵循了这篇文章 Getting Started With Angular 5 And ASP.NET Core

一切正常,但在发布时我才收到错误。

我已经运行了这个命令在node modules文件夹中,它给出了这些问题

  

C:\ Users \ acer \ source \ repos \ testfromcmd> node node_modules / webpack / bin / webpack.js --env.prod

     

哈希:40bd2f76867df4f7cc31ffb9aab17185511f568b

     

版本:webpack 2.5.1

     

子       哈希:40bd2f76867df4f7cc31       时间:26026ms                资产大小块大块名称       main-client.js 1.73 MB 0 [emit] [big] main-client

ERROR in main-client.js from UglifyJs
  

TypeError:无法读取属性'重置'未定义的           在filterdFiles.forEach(C:\ Users \ acer \ source \ repos \ testfromcmd \ node_modules \ webpack \ lib \ optimize \ UglifyJsPlugin.js:81:21)           在Array.forEach()           在Compilation.compilation.plugin(C:\ Users \ acer \ source \ repos \ testfromcmd \ node_modules \ webpack \ lib \ optimize \ UglifyJsPlugin.js:40:18)           在Compilation.applyPluginsAsyncSeries(C:\ Users \ acer \ source \ repos \ testfromcmd \ node_modules \ tapable \ lib \ Tapable.js:142:13)           at self.applyPluginsAsync.err(C:\ Users \ acer \ source \ repos \ testfromcmd \ node_modules \ webpack \ lib \ Compilation.js:635:10)           在Compilation.applyPluginsAsyncSeries(C:\ Users \ acer \ source \ repos \ testfromcmd \ node_modules \ tapable \ lib \ Tapable.js:131:46)           在sealPart2(C:\ Users \ acer \ source \ repos \ testfromcmd \ node_modules \ webpack \ lib \ Compilation.js:631:9)           在Compilation.applyPluginsAsyncSeries(C:\ Users \ acer \ source \ repos \ testfromcmd \ node_modules \ tapable \ lib \ Tapable.js:131:46)           在Compilation.seal(C:\ Users \ acer \ source \ repos \ testfromcmd \ node_modules \ webpack \ lib \ Compilation.js:579:8)           在C:\ Users \ acer \ source \ repos \ testfromcmd \ node_modules \ webpack \ lib \ Compiler.js:493:16           在C:\ Users \ acer \ source \ repos \ testfromcmd \ node_modules \ tapable \ lib \ Tapable.js:225:11           at _addModuleChain(C:\ Users \ acer \ source \ repos \ testfromcmd \ node_modules \ webpack \ lib \ Compilation.js:481:11)           at processModuleDependencies.err(C:\ Users \ acer \ source \ repos \ testfromcmd \ node_modules \ webpack \ lib \ Compilation.js:452:13)           at process._tickCallback(internal / process / next_tick.js:150:11)   儿童       哈希:ffb9aab17185511f568b       时间:26026ms                资产大小块大块名称       main-server.js 2.04 MB 0 [emit] [big] main-server

1 个答案:

答案 0 :(得分:1)

我通过将uglify版本从3.0.23更改为2.8.23解决了我的问题,这对我有用,感谢您的帮助