title: "npm run build -- --prod" error on Visual Studio 2017 .NET Core 2.1 Angular
body: <p>I need an help, i've made a project on Angular based with .Net Core 2.1.
  So when i try to publish VS return me this error: </p>
  
  <p><a href="https://i.stack.imgur.com/XF9L0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XF9L0.png" alt="enter image description here"></a></p>
  
  <p>So the error is: 
  <a href="https://i.stack.imgur.com/4t28O.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4t28O.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/Fcl6C.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Fcl6C.png" alt="enter image description here"></a></p>
  
  <p>So, i've followed this solution: 
  <a href="https://stackoverflow.com/questions/49643536/the-command-npm-run-build-prod-exited-with-code-1-error/50511768">The command &quot;npm run build -- --prod&quot; exited with code 1 error</a> but without succes, i didn't found this: <strong><em>npm run build -- --prod</em></strong>  on my <code>.angular-cli.json</code> 
  How can i solve this problem ? Thanks</p>
  
  <p><a href="https://i.stack.imgur.com/f6YUA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/f6YUA.png" alt="enter image description here"></a></p>
  
  <p>The logs: </p>
  
  <pre><code>    0 info it worked if it ends with ok
  1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
  1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
  1 verbose cli   'run',
  1 verbose cli   'build',
  1 verbose cli   '--',
  1 verbose cli   '--prod' ]
  2 info using npm@6.4.1
  3 info using node@v10.14.2
  4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
  5 info lifecycle ApoManagement@0.0.0~prebuild: ApoManagement@0.0.0
  6 info lifecycle ApoManagement@0.0.0~build: ApoManagement@0.0.0
  7 verbose lifecycle ApoManagement@0.0.0~build: unsafe-perm in lifecycle true
  8 verbose lifecycle ApoManagement@0.0.0~build: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\projects\ApoManagement\ApoManagement\ClientApp\node_modules\.bin;C:\Program Files (x86)\Parallels\Parallels Tools\Applications;C:\Program Files\Microsoft MPI\Bin\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\dotnet\;C:\Program Files (x86)\Skype\Phone\;C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\Users\MYUSER\AppData\Local\Programs\Python\Python36-32\Scripts\;C:\Users\MYUSER\AppData\Local\Programs\Python\Python36-32\;C:\Users\MYUSER\AppData\Local\Microsoft\WindowsApps;C:\Users\MYUSER\AppData\Local\atom\bin;C:\Program Files\Microsoft VS Code\bin;C:\Users\MYUSER\AppData\Local\Microsoft\WindowsApps;"C:\Users\MYUSER\AppData\Roaming\npm;C:\Program Files\nodejs";C:\Users\MYUSER\AppData\Roaming\npm
  9 verbose lifecycle ApoManagement@0.0.0~build: CWD: C:\projects\ApoManagement\ApoManagement\ClientApp
  10 silly lifecycle ApoManagement@0.0.0~build: Args: [ '/d /s /c', 'ng build --extract-css "--prod"' ]
  11 silly lifecycle ApoManagement@0.0.0~build: Returned: code: 1  signal: null
  12 info lifecycle ApoManagement@0.0.0~build: Failed to exec build script
  13 verbose stack Error: ApoManagement@0.0.0 build: `ng build --extract-css "--prod"`
  13 verbose stack Exit status 1
  13 verbose stack     at EventEmitter.&lt;anonymous&gt; (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
  13 verbose stack     at EventEmitter.emit (events.js:182:13)
  13 verbose stack     at ChildProcess.&lt;anonymous&gt; (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
  13 verbose stack     at ChildProcess.emit (events.js:182:13)
  13 verbose stack     at maybeClose (internal/child_process.js:962:16)
  13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
  14 verbose pkgid ApoManagement@0.0.0
  15 verbose cwd C:\projects\ApoManagement\ApoManagement\ClientApp
  16 verbose Windows_NT 10.0.17134
  17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build" "--" "--prod"
  18 verbose node v10.14.2
  19 verbose npm  v6.4.1
  20 error code ELIFECYCLE
  21 error errno 1
  22 error ApoManagement@0.0.0 build: `ng build --extract-css "--prod"`
  22 error Exit status 1
  23 error Failed at the ApoManagement@0.0.0 build script.
  23 error This is probably not a problem with npm. There is likely additional logging output above.
  24 verbose exit [ 1, true ]
  </code></pre>