Build error executing npm command in .NET Core csproj Target

Carlos Landeras's Avatar

Carlos Landeras

08 Jun, 2018 06:54 AM

Hello everyone!. I am having troubles trying to execute npm tasks on BeforeBuild target:

This are the tasks:

<Target Name="InstallPackages" BeforeTargets="BeforeBuild">
    <Message Importance="high" Text="*** Installing npm packages ***" />
    <Exec Command="npm install" ContinueOnError="false" />

  <Target Name="BuildClient" BeforeTargets="BeforeBuild" DependsOnTargets="InstallPackages">
    <Message Importance="high" Text="*** Bundling client files" />
    <Exec Command="npm run build" ContinueOnError="false" />

The second one "BuildClient", is executing the command npm run build that internally is this command:

  "build": "npm run build:dll && npm run build:prod"

Visual studio is building the project fine but I get an error in AppVeyor: npm run build exited with code 2.

Here is our appveyor.yml file :

Thank you very much!.

  1. Support Staff 1 Posted by Ilya Finkelshte... on 08 Jun, 2018 08:06 AM

    Ilya Finkelshteyn's Avatar

    I see your last build is good. Do you still need help?

  2. 2 Posted by Carlos Landeras on 08 Jun, 2018 08:28 AM

    Carlos Landeras's Avatar

    I fixed it thank you very much for your help! :)

  3. Ilya Finkelshteyn closed this discussion on 27 Aug, 2018 08:06 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac