1. NodeJs downloads the installation package
Baidu Cloud: Link: https://pan.baidu.com/s/169TdKRLZd0dXbKSGTr8evw extraction code: th4a copy the contents of this open Baidu network disk phone App, the operation more convenient oh
Official website: http://nodejs.cn/download/
2. Install Node.js
After the download is complete, you can install node, recommended not installed on the system disk (such as C :).
Provided nodejs prefix (global) and Cache (Cache) path
1, at nodejs installation path, and node_cache node_global two new folders
2, set the cache folder
npm config set cache "D:\vueProject\nodejs\node_cache"
Set global module storage path
npm config set prefix "D:\vueProject\nodejs\node_global"
After successful, followed by later npm install XXX -g command module installed in the D: \ vueProject \ nodejs \ node_global in
Third, based on Node.js installation cnpm (Taobao Mirror)
npm install -g cnpm --registry=https://registry.npm.taobao.org
Fourth, set the environment variable (very important)
3, the new system variable NODE_PATH
V. Installation Vue (cmd need to open the administrator)
cnpm install vue -g
六、安装vue命令行工具,即vue-cli 脚手架
cnpm install vue-cli -g
七、新项目的创建
1.打开存放新建项目的文件夹
打开开始菜单,输入 CMD,或使用快捷键 win+R,输入 CMD,敲回车,弹出命令提示符。打开你将要新建的项目目录
2.根据模版创建新项目
在当前目录下输入“vue init webpack-simple 项目名称(使用英文)”。
vue init webpack-simple mytest
初始化完成后的项目目录结构如下:
3、安装工程依赖模块
定位到mytest的工程目录下,安装该工程依赖的模块,这些模块将被安装在:mytest\node_module目录下,node_module文件夹会被新建,而且根据package.json的配置下载该项目的modules
cd mytest
cnpm install
4、运行该项目,测试一下该项目是否能够正常工作,这种方式是用nodejs来启动。
cnpm run dev