且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

找不到Bower命令的Windows

更新时间:2023-11-17 10:59:28

npm install -g bower之后,我也遇到了这个问题.我通过将npm的二进制文件夹添加到我的路径来解决了这个问题.

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. 找到npm全局二进制文件的位置:npm config get prefix.此路径可能类似于C:\Users\username\AppData\Roaming\npm(如果使用巧克力,则为C:\ProgramData\chocolatey\lib\nodejs.commandline.X.XX.XX\tools).
  2. 将第1步中的路径添加到您的路径中.

  1. Find the location of your npm global binaries: npm config get prefix. This path may look something like C:\Users\username\AppData\Roaming\npm (or C:\ProgramData\chocolatey\lib\nodejs.commandline.X.XX.XX\tools if you use Chocolatey).
  2. Add the path from step 1 to your Path.

  • 打开Windows控制面板,搜索environment,然后单击edit environment variables for your account或编辑系统环境变量.

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

查找名为PathPATH的变量,或者创建一个不存在的变量.

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

在此处粘贴第1步的路径(;分隔).

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

您可能需要重新启动命令提示符窗口.

You may need to restart your command prompt window.

您现在应该可以输入bower命令.

You should now be able to enter bower commands.