bower 不被识别为内部或外部命令 [英] bower is not recognised as an internal or external command

查看:72
本文介绍了bower 不被识别为内部或外部命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经成功安装了 nodejs 和 express 框架,但是我通过

I have successfully installed nodejs, and express framework, however I downloaded bower via

npm install -g bower

成功运行.

但是,每当我尝试使用 bower 安装某些东西时,我都会收到错误消息

However whenever I try to install something with bower I get the error message

bower is not recognised as an internal or external command

当我在我的计算机上搜索 bower 或 bower.exe 时,我找不到它.

when I search my computer for bower or a bower.exe I cannot locate it.

推荐答案

我也在使用 Windows 7,也遇到了这个问题.

I am using Windows 7 as well and had this problem too.

在我执行了Scott Marchant 的回答中列出的步骤后,bower 开始工作了.

After I took the steps outlined in Scott Marchant's answer, bower worked.

找到您的 npm 全局二进制文件的位置:npm config get 前缀.此路径可能类似于 C:UsersusernameAppDataRoaming pm.将步骤 1 中的路径添加到您的路径中.

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.

打开 Windows 控制面板,搜索环境,然后单击编辑您帐户的环境变量或编辑系统环境变量`.

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.

这篇关于bower 不被识别为内部或外部命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆