Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
503 views
in Technique[技术] by (71.8m points)

node.js - bower is not recognised as an internal or external command

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.

Find the location of your npm global binaries: npm config get prefix. This path may look something like C:UsersusernameAppDataRoaming pm. Add the path from step 1 to your Path.

Open the Windows Control Panel, search for environment, then click on either edit environment variables for your account, or Edit the system environment variables`.

Find the variable named Path or PATH, or create one if it doesn't exist.

Paste the path from step 1 here (; delimited).

You may need to restart your command prompt window.

You should now be able to enter bower commands.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...