bootstrap之編譯CSS和Javascript-0基礎安裝grunt教程

來源:互聯網
上載者:User

標籤:detail   href   許可權   pack   擴充   hub   margin   ges   sdn   

昨天晚上看到 bootstrap 全域CSS樣式中 使用Less 章節中提到的通過grunt重新編譯CSS和Javascript檔案,對於我這樣從未接觸過windows cmd node控制台 npm的人,學習起來就有很大的難度了。

那麼我們照著教程一步一步來:

第一步:安裝node.js

網址:https://nodejs.org/en/download/

下載版本:node-v6.10.2-x64.msi

 

如果遇見2502 2503錯誤,可以查看這個地址,實測有效,許可權不夠導致的問題:

http://blog.csdn.net/shuideyidi/article/details/46891559#comments#0-tsina-1-94252-397232819ff9a47a7b7e80a40613cfe1

 

第二步:在全域環境中安裝 grunt-cli :npm install -g grunt-cli 。

  快速鍵 win + R運行框中輸入cmd,開啟系統命令執行程式,輸入以下,請注意不要輸入最前面的grunt-cli :

  

  安裝成功:

  

 

  第三步:進入 /bootstrap/ 根目錄,然後執行 npm install 命令。npm 將讀取 package.json 檔案並自動安裝此檔案中列出的所有被依賴的擴充包。

  這裡遇到的問題就是怎麼進入根目錄,作為一臉懵逼的新人,百度了許久。其中只有2個dos命令需要用到 1:cd.. 2:cd ** 

  cd.. : 返回上級檔案夾,例如:

  

  cd ** :進入某個檔案夾,例如:

  

  知道了這個以後就知道了如何進入bootstrap根目錄。

 

  進入了bootsrap根目錄之後需要執行npm install

 

  執行完畢後就依然開啟cmd 輸入grunt dist就OK啦~

  

  

bootstrap之編譯CSS和Javascript-0基礎安裝grunt教程

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.