1. npm 环境调试
node.js安装 http://nodejs.cn/download/ 选择对应的版本下载安装。
管理员身份运行 cmd
查看 npm -v
2.npm 注册淘宝镜像
- 临时使用
npm --registry https://registry.npm.taobao.org install express
2.持久使用
npm config set registry https://registry.npm.taobao.org
配置后可通过下面方式来验证是否成功
npm config get registry
或
npm info express
3.通过cnpm使用
npm install -g cnpm --registry=https://registry.npm.taobao.org
3. vue cli安装卸载
vue cli 2.9.X 安装和卸载
npm install vue-cli -g
npm uninstall vue-cli -g
vue cli 3.X 安装和卸载
npm install -g @vue/cli
npm uninstall -g @vue/cli
4. vue-cli webpack 创建一个项目(vue-cli 2.9.x)
创建指令
vue init webpack firstvue
Project name firstvue
? Project description A Vue.js project
? Author
? Vue build standalone
? Install vue-router? No
? Use ESLint to lint your code? No
? Set up unit tests No
? Setup e2e tests with Nightwatch? No
? Should we run `npm install` for you after the project has been created? (recommended) no
vue-cli · Generated "firstvue".
# Project initialization finished!
# ========================
To get started:
cd firstvue
npm install (or if using yarn: yarn)
npm run dev