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
3.9k views
in Technique[技术] by (71.8m points)

node.js - bower command not found windows

I am having huge problems trying to use bower (to install foundation 5) or get anything bower related to work on the command line.

I've installed

  • ruby 1.9.3
  • git (with run from command prompt option)
  • Nodejs

I've successfully ran

npm install -g bower grunt-cli
gem install foundation

and these have ran fine. I've looked in the npm/node_modules directory and I can see bower folder in there.

Every time I type bower either into the cmd, ruby cmd or git bash I get

command not recognized

I've set the git path in the environment variables.

What's annoying is the instruction on the bower site. It states:

npm install -g bower
bower install

Well this doesn't work!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
by (100 points)

You can check this link too may be useful ( https://kodlogs.net/307/bower-command-not-found)

Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I bumped into this problem after npm install -g bower too. I solved the problem by adding npm's binary folder to my path.

Here are some helpful hints for doing that:

  1. Find the location of your npm global binaries: npm config get prefix. This path may look something like C:UsersusernameAppDataRoaming pm (or C:ProgramDatachocolateylib odejs.commandline.X.XX.XXools if you use Chocolatey).
  2. 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.

  3. 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

Just Browsing Browsing

[1] html - How to create even cell spacing within a

2.1m questions

2.1m answers

60 comments

57.0k users

...