1、先安装nodejs环境
查看官文
2、切换到国内源
镜像使用方法(三种办法任意一种都能解决问题,建议使用第三种,将配置写死,下次用的时候配置还在):
1.通过config命令
npm config set registry https://registry.npm.taobao.org
npm info underscore (如果上面配置正确这个命令会有字符串response)
2.命令行指定
npm –registry https://registry.npm.taobao.org info underscore
3.编辑 ~/.npmrc 加入下面内容
registry = https://registry.npm.taobao.org
搜索镜像: https://npm.taobao.org
建立或使用镜像,参考: https://github.com/cnpm/cnpmjs.org
4.使用cnpm
npm install cnpm -g –registry=https://registry.npm.taobao.org
执行成功后,执行如下命令下载依赖
cnpm install
依赖包下载完成后,执行如下命令启动项目
cnpm run dev
创建工程
vue init webpack projectName
3. Yarn安装
1 、npm install -g yarn 安装yarn
2、yarn config set registry “https://registry.npm.taobao.org” 设置代理
3、进入到项目目录下执行
yarn install
yarn run dev
https://github.com/taylorchen709/vue-admin
http://vue.tigerb.cn/#/
4. 国内优秀npm镜像
淘宝npm镜像
搜索地址:http://npm.taobao.org/
registry地址:http://registry.npm.taobao.org/
cnpmjs镜像
搜索地址:http://cnpmjs.org/
registry地址:http://r.cnpmjs.org/
配置npm的registry方法,以淘宝npm镜像举例:
4.1.临时使用
npm –registry https://registry.npm.taobao.org install express
4.2.持久使用
npm config set registry https://registry.npm.taobao.org
// 配置后可通过下面方式来验证是否成功
npm config get registry
// 或
npm info express
4.3.通过cnpm使用
npm install -g cnpm –registry=https://registry.npm.taobao.org
// 使用
cnpm install express
5. 适合初学者的开源Vue项目
vue-material
muse-ui
vue2-manage
vue2-elm
webapp
vue-jd
MissCloudVue
VueCnodeJS
tong2-family
vue-admin
easy-vue
6. 推荐IDE
- WebStrom
- Atom