msbuildbowerazure-devopsbower-install

Visual Studio Online MSBuild fails when doing bower install


I have a simple web project with a bower.json, package.json and a Gruntfile.js I have modified my .csproj file to add targets to run

  1. npm install
  2. bower install
  3. grunt build

npm install runs fine but it fails to run bower install. This is all that I have from the logs

node_modules\.bin\bower cache clean
node_modules\.bin\bower install

C:\a\src\TestProj\TestProj\TestProj.csproj(137,5): error MSB3073: The command ".\node_modules\.bin\bower install" exited with code 1.

Here is what I am doing in the csproj definitio

<Target Name="BeforeBuild">
    <Exec Command="npm cache clean" />
    <Exec Command="npm install" />
    <Exec Command="node_modules\.bin\bower cache clean" />
    <Exec Command="node_modules\.bin\bower install" />
</Target>

Here is my bower.json

 "name": "TestProj",
 "version": "0.0.1",
 "description": "",
 "main": "index.html",
 "moduleType": [
   "amd"
 ],
 "authors": [
   "Sujesh Arukil"
 ],
 "license": "MIT",
 "private": true,
 "ignore": [
   "**/.*",
   "node_modules",
   "bower_components",
   "test",
   "tests"
 ],
 "devDependencies": {
   "knockoutjs": "~3.2.0"
 }

Solution

  • the bower install was failing because two modules that I was intalling depended on different versions of jQuery and could not find a resolution and wanted user input. Fixed it by providing a resolution section.