angular / angular-seed

Seed project for angular apps.
http://angularjs.org/
MIT License
13.03k stars 6.93k forks source link

bower is not found when doing bower update but it did install the packages in the npm install step #383

Closed LJNielsenDk closed 7 years ago

LJNielsenDk commented 7 years ago

Am I supposed to add it to the path myself or should it just work? If the former, the guide should probably mention this.

I'm on Windows 10 using node v7.0.0 and running the commands in it's Node.js command prompt.

I have tried running bower update in the same Node.js command prompt as npm install and a new one opened after that step.

Am I doing/expecting something silly, is something broken, or does the guide need updating?

deminyx commented 7 years ago

Got the same problem a few minutes ago...

gkalpak commented 7 years ago

In order to avoid poluting your global packages or suffer from version-mismatch issues, angular-seed does not rely on a global bower installation. If you want to be able to run bower <command> directly from the terminal, you can install bower globally with npm install --global bower (but it is not necessary for angular-seed).

Instead, angular-seed installs and runs bower locally (as a local npm dependency). The project is set up to automatically run bower install right after npm install, so you don't have to manually run it. The reason this works from within the post-install npm script, is that npm scripts can also find local executables; i.e. those in node_modules/.bin/.

If you want to manually run bower without a global installation, you can run node_modules/.bin/bower.cmd <command> from inside the projects root directory.

Closing, since everything works as intended.

gkalpak commented 7 years ago

I just realized we suggest running bower update in README as a way to update bower dependencies. That will clearly not work unless bower is installed globally. I will submit a PR with a fix shortly.