網上廣泛都是命令行的使用入門教程, 對於各類概念不解釋,好不容易找到一個國外的:https://www.sitepoint.com/beg...前端
可是國內由於牆的問題, 連不上服務器, 因此還須要一個國內鏡像:http://ju.outofmemory.cn/entr...vue
基於Nodejs運行node
軟件模塊管理工具(軟件包工具), 對應我這個Javaer來講,有點相似於Mavenlinux
如今廣泛用於web前端項目的管理, 主要是各類依賴庫的管理web
命令行形式運行npm
速度很是快,徹底不像國外的網站服務器
windows, linux, 32/65bit, 各個版本齊全session
驗證成功:
node --versionide
Node命令的語法跟一般有點不一樣, 首先,參數都是加兩個-的, 其次, 命令以.開頭,好比:
$ node > console.log('Node is running'); Node is running > .help .break Sometimes you get stuck, this gets you out .clear Alias for .break .exit Exit the repl .help Show repl options .load Load JS from a file into the REPL session .save Save all evaluated commands in this REPL session to a file> .exit
Node裝完之後, npm連帶着就裝上了, 能夠直接驗證
$ npm --version
教程裏關於默認位置和參數的修改,就直接跳過了, 先嚐試使用
先嚐試簡單的安裝
npm install uglify-js --global
發現默認源安裝好慢,簡直沒法容忍,仍是換一個吧,淘寶有國內鏡像:
https://npm.taobao.org/
安裝方式:
npm install -g cnpm --registry=https://registry.npm.taobao.org
之後就使用cnpm來代替npm了
再次嘗試原來的命令
cnpm install uglify-js --global
迅速完成
本地安裝: npm最好的地方在於, 缺省狀況下(不帶--global參數), 是安裝到本地文件夾的.
npm install underscore
查看本地安裝包: npm list
發現cnpm不是萬能的, 剛纔的underscore就,沒有, 拿Vue來練手卻是成功了npm install vue