Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"bower install" exited with code 9009. in ASP.NET core application

I am facing an issue of

The command "bower install" exited with code 9009

while publishing the ASP.NET core-MVC application with entity framework. I am using VS-2017.

I got many suggestions in your portal of downloading node.js globally, but as I am very new to this system I don't know how to do so. Or if there is any other solution for that please let me know.

like image 747
Rishabh Avatar asked May 22 '17 13:05

Rishabh


3 Answers

  1. Make sure to install Node.js.
  2. Install bower globally by executing the following command in cmd:

    npm install -g bower

  3. Close Visual Studio, then open it and try again.

like image 113
Natia Avatar answered Nov 18 '22 05:11

Natia


Also worked for me by removing the code below in the project file.

<Target Name="PrepublishScript" BeforeTargets="PrepareForPublish">
<Exec Command="bower install" />
<Exec Command="dotnet bundle" />

However it did cause a couple of typescript issues with duplicate method names, add the below code to the tsconfig.json file

"exclude": [ "obj" ]

like image 12
Ryan Gavin Avatar answered Nov 18 '22 06:11

Ryan Gavin


What worked for me.

I went to project file (in VS-2017 Explorer you can right-click it and edit it)

Then I deleted (or commented) the Target node

  <Target Name="PrepublishScript" BeforeTargets="PrepareForPublish">
    <Exec Command="bower install" />
    <Exec Command="dotnet bundle" />
  </Target>

Everything was fine without installing anything else.

like image 11
fermat Avatar answered Nov 18 '22 06:11

fermat