Error MSB3073: The command "node node_modules/webpack/bin/webpack.js --env.prod" exited with code 2

Bhuvanesh picture Bhuvanesh · Feb 4, 2018 · Viewed 11.4k times · Source

I'm building web application using asp.net core 2x and angular 5,during development/debug mode everything is getting build well.But when i try to publish it with release mode in visual studio 2017 am getting this error.please help me to resolve this.Am not using this in my code but it exists. Function calls are not supported in decorators but 'makeParamDecorator' was called in 'Injectable' 'Injectable' calls 'makeParamDecorator'.Please help.Thanks in advance.Screenshot of my error message

Answer

Cristina Carrasco picture Cristina Carrasco · Feb 11, 2018

You need to run this on console: node node_modules/webpack/bin/webpack.js --env.prod

then you will get the list of all the issues, and need to solve all of them, someone gonna be like:

ERROR in navmenu.component.html: Property 'auth' is protected and only accessible within class 'NavMenuComponent' and its subclasses.

another case:

ERROR in Error at estados.component.html(19,72): Expected 0 arguments, but got 1.
Error at home.component.html(8,12): Property 'selectedCharacter' does not exist on type 'HomeComponent'. Did you mean 'selectedCharacters'?

Each error have a different solution, you need to solve them all.

You can check this link: Angular – The command “node node_modules/webpack/bin/webpack.js –env.prod” exited with code 2 and similar errors: how to fix them