一。安装nodejs
安装包下载地址:http://nodejs.cn/download/ 下载安装。
打开CMD 执行以下命令行
E:\webstorm\first>node -v //查看当前nodejs的版本号 。
二。使用NPM初始化与安装 (NPM常用命令)
打开CMD 执行以下命令行
E:\webstorm\first>npm init //初始化生成 package.json,. 默认创建,就不停的回车
E:\webstorm\first>npm init -f //初始化不需人工
E:\webstorm\first>type package.json //查看package.json
E:\webstorm\first>npm config set registry https://registry.npm.taobao.org //npm指向淘宝NPM镜像 https://registry.npm.taobao.org/
E:\webstorm\first>npm install jquery //安装jquery包
E:\webstorm\first>npm install jquery --save-dev //开发环境使用
E:\webstorm\first>npm root -g //查看全局安装的文件夹位置
-S , --save 安装包信息将加入到 生产阶段的依赖(dependencies)
-D, --save-dev,--save --dev 安装包信息将加入到 开发阶段的依赖(devDependencies)
三。安装VUE
打开CMD 执行以下命令行
E:\webstorm\first>npm install -g vue //安装VUE
E:\webstorm\first>npm install -g @vue/cli //安装命令行工具
E:\webstorm\first>npm install -g vue-cli //安装命令行工具
E:\webstorm\first>npm uninstall -g vue-cli //泄载
E:\webstorm\first>vue -V //查看当前@vue/cli的版本号 。
四。生成项目
打开CMD 执行以下命令行
E:\webstorm>vue create hello-vue //创建项目 . 默认创建,就不停的回车
E:\webstorm>cd hello-vue //进入项目目录
E:\webstorm>npm run serve //启动项目
五。访问地址:http://localhost:8081/
参考视频:
https://v.youku.com/v_show/id_XNDQ0NjQxOTgzNg==.html
https://learning.dcloud.io/#/?vid=1
参考文档:
https://cn.vuejs.org/v2/guide/
https://cli.vuejs.org/zh/guide/