I have successfully installed nodejs, and express framework, however I downloaded bower via
npm install -g bower
which ran successfully.
However whenever I try to install something with bower I get the error message
bower is not recognised as an internal or external command
when I search my computer for bower or a bower.exe I cannot locate it.
Check were your cmd prompt/bash is located when you have successfully commanded "npm install"
Look for the any of the following. -bower.cmd - windows command script -bower - file you can do a quick search in the directory.
if you find it, copy the path to the file. "I found mine in the directory where I successfully performed npm install" + node_modules.bin" - "D:\Work\notepadplusplus\htdocs\laravel-main\angulartest\public\fed\node_modules.bin"
Then do these
There is no specific path since we all have different structure of our directories. The only precise thing here is to find the bower.cmd location and that will be used to the Path to your windows environment.
Although we have already good answers here, I will give an extra hint. Check if you have a .npmrc file inside the folder /Users/YOUR_USER/. When this problem happened to me, my .npmrc file had this content:
Due to prefix and cache lines, the bower was being installed inside the folder specified in prefix.
SOLUTION: I deleted prefix and cache lines. The I installed bower again with the following command:
After that, my bower became global as expected.
C:\Users\[username]\AppData\Roaming\npm;
should exist in PATH for both "User Variables" and "System Variables"
I just wanted to add update to windows 10 users, I found that typing bower into the search bar will return "run command" option. Execute that and it will then prompt if bower can submit info, return a y/n and you should be good to go.
I am using Windows 7 as well and had this problem too.
After I took the steps outlined in Scott Marchant's answer, bower worked.
Installing Bower Windows: