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! :)

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

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

Recent Discussions

18 Aug, 2018 12:13 AM
17 Aug, 2018 09:45 PM
17 Aug, 2018 06:02 PM
17 Aug, 2018 04:26 PM
17 Aug, 2018 04:04 PM