grunt安装与环境配置

注:在DOS环境下切入至项目目录进行安装       e:    ->  cdfilename

不在项目下安装可能会导致Gruntfile找不到

1. Install NPM
brew update
brew install node

2. Install Grunt
npm install -g grunt-cli
npm install grunt --save-dev

3. Install Bower
npm install -g bower

4. Check out
Check out code and enter the project directory. run below command to install grunt task and 3rd code.

cd [filename]
npm install

bower install

5.grunt

可能遇见的问题:exec:compile_newUI_sass

解决:安装ruby并在电脑中配置环境

设置系统变量RUBY_HOME为ruby实际位置,在系统变量path中添加%RUBY_HOME%in,在用户变量中添加位置至bin,然后再运行gem install sass,可运行sass -v查看是否成功

6.nginx安装后配置nginx.conf,改变root为项目所在位置,启动nginx.exe

7.浏览器中输入localhost:8080

原文地址:https://www.cnblogs.com/family-626-77/p/5893443.html