Langutang
Langutang

Reputation: 43

Post-build Vue application in Visual Studio gives a "The command npm run build exited with code 1"

I am building a Vue app in visual studio and after running the build, I am left with the error: The command npm run build exited with code 1. I noticed it happening in the Post-build of my Vue App with the following line of code:

<Exec WorkingDirectory="$(OutDir)" Command="$(PostBuildEvent)"/>

this is my entire post build script:

<PropertyGroup>
<PostBuildEventDependsOn></PostBuildEventDependsOn>
</PropertyGroup>
<Target
  Name="PostBuildEvent"
  Condition="'$(PostBuildEvent)' != '' and ('$(RunPostBuildEvent)' != 'OnOutputUpdated' or '$(_AssemblyTimestampBeforeCompile)' != '$(_AssemblyTimestampAfterCompile)')"
  DependsOnTargets="$(PostBuildEventDependsOn)">

<Exec WorkingDirectory="$(OutDir)" Command="$(PostBuildEvent)"/>

I expect a package javascript file to be put in my 'dist' folder of the Vue app. Thank you for your help.

Upvotes: 1

Views: 659

Answers (1)

Langutang
Langutang

Reputation: 43

Simply had to run VS as administrator.

Upvotes: 2

Related Questions