一,配置nodejs
第一大步,首先安装nodejs,安装nodejs的时候,我们需要把所有的组建勾选上,然后选择add to path,这一步会自动帮我们配置环境变量,安装完成后,打开cmd,输入node -v查看安装版本,如果有结果显示则表示安装成功。
npm是nodejs的包管理工具,然后再cmd输入命令npm -v,查看npm对应的版本信息,或者输入npm,显示结果如图所示:
重要信息:
如果在安装bower过程中遇到:Bower : ENOGIT git is not installed or not in the PATH
解决方法:需要把git的bin,和cmd的文件路径配置到path中,重启电脑即可
三配置git:
第一次使用bower,结果在安装bootstrap时遇到这个问题:
$ bower install bootstrap
bower ENOGIT git is not installed or not in the PATH
按照提示我先安装了git fo window.
安装时记得要勾选 Use Git from the windows Command prompt
完成后,再次运行,问题依然存在。
于是又注意到“or not in the PAHT”
$ PATH
添加git路径(我的是默认安装路径)
$ set PATH=%PATH%;C:\Program Files\Git\bin
再次运行
$ bower install bootstrap
...
转自:http://www.w3cfuns.com/notes/22190/03fe7e7a51276969c2d6aa6fff8d259c.html