Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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"
 }
like image 474
Sujesh Arukil Avatar asked Aug 21 '14 17:08

Sujesh Arukil


2 Answers

I was able to hack past this issue by commenting out the bower install command in the .csproj file

  <Target Name="PrepublishScript" BeforeTargets="PrepareForPublish">
    <!--<Exec Command="bower install" />-->
    <Exec Command="dotnet bundle" />
  </Target>
like image 113
Derrick Avatar answered Oct 29 '22 22:10

Derrick


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.

like image 23
Sujesh Arukil Avatar answered Oct 29 '22 23:10

Sujesh Arukil