0

When I try to install bower in my working project folder using npm install -g bower command in Windows 7 it is installed in another folder. I delete that folder and try to reinstall it. But again automatically that folder is created and bower is installed within that folder. See the attached image. I want to install bower in the otenro folder. But each and every time it is installed in angular folder. How do I change that?

PiotrWolkowski
  • 8,408
  • 6
  • 48
  • 68
kalani
  • 15
  • 7

2 Answers2

0

You need to add a new file in the root of the project. The file has no name, only with the extension:

.bowerrc

with this:

{
  "directory": "Mynewdirectory/newfolder/subfolder"
}
manuerumx
  • 1,230
  • 14
  • 28
  • 1
    @kalani you should mark the right answer to help others. – manuerumx Sep 28 '16 at 17:48
  • In my case I solved my problem by using [ npm config set prefix "C:\My\New\Location" ]. It works for me. I already included .bowerrc file with { "directory": "Mynewdirectory/newfolder/subfolder" } but It didn't work. – kalani Sep 28 '16 at 18:06
  • Then mark the @PiotrWolkowski answer as the right. This is how the site works. – manuerumx Sep 28 '16 at 18:07
0

To see your default install location:

npm list -g

To change your default install location:

npm config set prefix "C:\My\New\Location"

So after changing the install location just install bower and it will be installed there. This thread and this thread can help in any further investigation.

Community
  • 1
  • 1
PiotrWolkowski
  • 8,408
  • 6
  • 48
  • 68