Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
504 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 Reply

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...