更新时间: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:
npm config get prefix
.此路径可能类似于C:\Users\username\AppData\Roaming\npm
(如果使用巧克力,则为C:\ProgramData\chocolatey\lib\nodejs.commandline.X.XX.XX\tools
).将第1步中的路径添加到您的路径中.
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).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`.
查找名为Path
或PATH
的变量,或者创建一个不存在的变量.
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.