windows下vscode安装vue
一
https://code.visualstudio.com/download 下载
允许安装程序,选择安装文件夹
安装中文安装包,在有点像田字图形下输入Chinese
同时安装vue支持vetur
下载node.js
https://nodejs.org/en/download/选择合适版本
运行安装程序,选择安装文件夹
配置系统环境
cmd输入
node -v显示版本表示成功
npm -v显示版本表示成功
配置npm与node
如果没有先检查安装目录,环境,否则就安装npm
二
vue脚手架安装
npm uninstall vue-cli卸载
命令行执行 : npm install -g vue-cli // 加-g是安装到全局
国内优秀npm镜像:
淘宝npm镜像官方网站:http://npm.taobao.org/
registry地址:http://registry.npm.taobao.org/
cnpmjs镜像官方网站:https://cnpmjs.org/
registry地址:http://r.cnpmjs.org/
使用镜像
npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm install cli-shared-utils
npm --registry https://registry.npm.taobao.org install cluster -g
打开vscode 打开项目文件夹
(1)以管理员身份运行vs code
(2)在终端执行:get-ExecutionPolicy,显示Restricted(表示状态是禁止的)
(3)在终端执行:set-ExecutionPolicy RemoteSigned
(4)在终端执行:get-ExecutionPolicy,显示RemoteSigned
全局更新
npm install npm -g
npm install -g cli-cursor或者yarn global add cli-cursor
或者用淘宝镜像命令
cnpm install npm -g
创建一个vue
方法1:
“webpack-dev-server”: “^2.9.1”
删除 node_modules 目录,再重新安装依赖包
npm install -S // 这种方式安装的时间会长些,也可以只重装 webpack-dev-server模块
**方法2:**单独重装 webpack-dev-server模块
(1)npm uninstall webpack-dev-server
(2)npm install webpack-dev-server@2.9.1
(3)npm run dev
vue init webpack demo
cd demo打开文件夹
npm install安装没有安装的插件
npm run dev运行项目
相关插件
“dependencies”: {
“axios”: “^0.20.0”, 跨域访问
“element-ui”: “^2.13.2”, element-ui 框架使用
“file-saver”: “^2.0.2”, 导出表格
“vue”: “^2.5.2”,vue使用
“vue-router”: “^3.0.1”,vue路由router使用
“xlsx”: "^0.16.6"表格插件
},