基于脚手架创建前端工程
环境
- 当安装
node.js
时,它本身就携带有npm
命令。(-v 查版本号) - 安装VUE CLI
npm i @vue/cli -g
(全局)

创建

vue create 【project name】
镜像源解决方案
输入创建命令后,提示检查更新失败了???
原因是 淘宝源证书严格检查的 其证书失效了。过期将无法访问就会导致插件更新失败
- 如何解决呢?
将镜像源换成官方源
bash#1. 查看当前源 npm config get registry #2. 更换npm源为国内npm官方镜像 npm config set registry http://registry.npmjs.org/
紧接着, 把证书检查关了
bash
# 把证书检查关了
npm cache clean --force
npm config set strict-ssl false
npm install
方法二:更换为最新的淘宝源
npm config set registry https://registry.npmmirror.com npm config set registry https://registry.npm.taobao.org
注意你如果还想继续使用淘宝镜像源的话,一定要确保 C:\Users\Administrator目录下的.vuerc文件,其配置为:
"useTaobaoRegistry": true
bash
> {
"useTaobaoRegistry": true, //此处为true,表示继续使用淘宝镜像源
"packageManager": "yarn"
}
查看当前使用的镜像地址:npm config get registry
常用镜像# 淘宝镜像源 https://registry.npmmirror.com https://registry.npm.taobao.org
查看当前镜像源

vue ui
项目结构

思考?前后端端口号冲突
