bower icon indicating copy to clipboard operation
bower copied to clipboard

bowerrc not respected

Open kirkstrobeck opened this issue 14 years ago • 28 comments

I have a .bowerrc file in my mac home folder ( cd ~) with the contents

{
  "directory" : "assets/components"
}

but it still uses the directory ./components

kirkstrobeck avatar Oct 23 '12 00:10 kirkstrobeck

update to 0.3.0

fat avatar Oct 23 '12 05:10 fat

Still doesn't work ..

kirkstrobeck avatar Oct 23 '12 11:10 kirkstrobeck

@kirkstrobeck do you have a .bowerrc in your project folder?

If not, can you please open your global node_modules/bower/node_modules/rc/index.js and do a console.log of:

    argv,
    cc.env(name + '_'),
    argv.config,
    join(home, '.' + name + 'rc'),
    join(home, '.' + name, 'config'),
    join(home, '.config', name),
    join(home, '.config', name, 'config'),
    win ? null : join(etc, name + 'rc'),
    win ? null : join(etc, name, 'config'),
    defaults

and show us the output?

satazor avatar Oct 23 '12 12:10 satazor

Oh, project folder .. the README doesn't say that. Thanks, got it working.

kirkstrobeck avatar Oct 23 '12 12:10 kirkstrobeck

@kirkstrobeck I'll add it to the README. The feature of reading local project bowerrc files was added yesterday.

satazor avatar Oct 23 '12 12:10 satazor

Rock on. Thx @satazor @fat

kirkstrobeck avatar Oct 23 '12 12:10 kirkstrobeck

@kirkstrobeck Still, if you didn't have any .bowerrc file located in your project root folder, it should read the ~/.bowerrc one. Was that the case?

satazor avatar Oct 23 '12 12:10 satazor

No, it was not using it

kirkstrobeck avatar Oct 23 '12 12:10 kirkstrobeck

@kirkstrobeck ok, so you didn't had any local bowerrc file and it was not reading the one in your home folder. Can you please show me the console.log I requested in my comment above?

satazor avatar Oct 23 '12 12:10 satazor

hmm, bower isn't in there .. that's probably the reason ..

Running npm install bower -g doesn't create bower in ~/node_modules

kirkstrobeck avatar Oct 23 '12 12:10 kirkstrobeck

Yes, it can be related.

Can you do a console.log(process.env.HOME) in node and tell us the output? If is something different than your home folder than you have to put the bowerrc there.

Still the documentation needs to be updated accordingly.

satazor avatar Oct 23 '12 13:10 satazor

/Users/kirk it is the same as my home folder

kirkstrobeck avatar Oct 23 '12 14:10 kirkstrobeck

@kirkstrobeck thats very strange.. I just tested putting bowerrc in my home folder and bower reads it correctly

satazor avatar Oct 23 '12 17:10 satazor

This still isn't working for me with 0.9.6

Same issue described here: https://github.com/yeoman/yeoman/issues/622#issuecomment-11354098

timkelty avatar Dec 17 '12 14:12 timkelty

This issue still exists for me as well. Windows 8 x64 node.exe 0.10.10, bower 0.9.2

atomi avatar Jun 07 '13 21:06 atomi

Having the same issue. Bower - 1.4.1, node - 0.12.0.

vdeep avatar Apr 18 '15 20:04 vdeep

Same issue here, using linux mint, bower 1.7.1 Not using ~/.bowerrc, if I create it in project folder it works, but never uses home folder

bevinhex avatar Dec 12 '15 10:12 bevinhex

Works for me on 1.7.1.. Can you post your full environment? (bower version, node version, os version)

sheerun avatar Dec 12 '15 15:12 sheerun

->nodejs -v
v4.2.3
->uname -a
Linux bevin-silent 3.16.0-38-generic #52~14.04.1-Ubuntu SMP Fri May 8 09:43:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Lin
->bower -v
1.7.1

bevinhex avatar Dec 12 '15 15:12 bevinhex

@bevinhex Could you post the directory of the project, contents of .bowerrc? Do you use sudo for bower?

sheerun avatar Dec 12 '15 17:12 sheerun