AngularJS項目環境搭建



Run a project
-------------
1. Install Node.js(set PATH="C:\Program Files\nodejs\")
2. Install Yeoman
   - npm install -g yo
3. Install Grunt locally
   - npm install grunt
4. Install git(set PATH="C:\Program Files\nodejs;C:\Program Files\Git\bin;C:\Program Files\Git\cmd")
5. Install bower dependency
   - npm install bower
6. Install project dependency
   - npm install
7. Install Ruby
8. Install Compass(download chunky_png-1.3.1.gem, compass-0.12.7.gem, fssm-0.2.10.gem, sass-3.2.19.gem and put them into Ruby install path)
    - CMD line (cd to Ruby install path)
    - gem install sass -v 3.2.19
    - gem install compass
9. Run the project
   - grunt serve


在以上過程中,會出現不能執行grunt命令, 解決方案:

安裝grunt需要先安裝node.js。現在node的安裝也很方便,下載下來直接安裝完成之後,在cmd下測試node --version和npm --version是否正確顯示即可。

之後需要藉助npm來安裝grunt-cli,注意,不是安裝grunt。想要在cmd中使用grunt命令,需要npm install -g grunt-cli。完成後測試grunt --version看是否正確顯示grunt-cli版本。

這樣,就完成了grunt的安裝。


還出現 :Warning:You need to have Ruby and Compass installed and in your system PATH for
Use --force to continue. 解決方案:

把你的ruby和compress的安裝目錄加入path環境變量中即可.控制面板->系統->屬性->高級系統設置->環境變量。 在用戶變量中,修改或者增加PATH變量,值增加或者修改爲你的ruby路徑,例如F:\Program Files\Ruby200-x64\bin;

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章