网上广泛都是命令行的使用入门教程, 对于各类概念不解释,好不容易找到一个国外的: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