1

I have checked the question "bower command not found windows" and many more, but still can't find an answer for bash inside windows 10.

I am not very familiar with windows and bash so I always have troubles doing anything dev-oriented on windows.

So I could install npm from windows command prompt then run npm install bower from command prompt. then when I type bower in windows command prompt no problem it will find it. But from bash, bower returns No such file or directory. Still if I do npm from bash it will work.

Then I tried from bash:

sudo su
npm install -gf bower

and got:

npm WARN using --force I sure hope you know what you are doing.
npm http GET https://registry.npmjs.org/bower
npm http 200 https://registry.npmjs.org/bower
npm http GET https://registry.npmjs.org/bower/-/bower-1.8.0.tgz
npm http 200 https://registry.npmjs.org/bower/-/bower-1.8.0.tgz
/usr/local/bin/bower -> /usr/local/lib/node_modules/bower/bin/bower
bower@1.8.0 /usr/local/lib/node_modules/bower

After that bower is still unknown.

I think it is a path problem... This echo $PATH will return

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
Community
  • 1
  • 1
antoni
  • 5,001
  • 1
  • 35
  • 44

1 Answers1

0

Ok after a while I found a way, so I found good to share is someone has same problem.

  1. I inspected my $PATH where it was missing the bower path, I edited it with: PATH=$PATH:/mnt/d/Users/my_name/AppData/Roaming/npm/bower. Note that a drive is accessible from /mnt/[letter].

  2. Then when trying bower again it would tell me /usr/bin/env: node: Not a directory. So I created a symbolic link to "node": ln -s /usr/bin/nodejs /usr/bin/node.

It works! :)

antoni
  • 5,001
  • 1
  • 35
  • 44