vue脚手架的使用,下载依赖方法
安装:npm install -g @vue/cli创建一个文件夹vue create pro选择Manually select features 自行进行配置(下面的进行参照)之后进入 文件 并运行cd pronpm run serve浏览器中打开即可...
1 脚手架
第一种:使用vue create
安装:可以分为npm 和yarn以及bun
如果是yarn,首先要安装yarn
npm i yarn -g
版本:yarn -v
如果是bun,首先要安装bun
npm install bun -g
版本:bun -v
下载cli脚手架
1、npm install -g @vue/cli
2、yarn global add @vue/cli
版本:
vue --version
创建一个文件夹
vue create pro

选择Manually select features 自行进行配置(下面的进行参照)

之后进入 文件 并运行
cd pro
npm run serve
yarn run serve
bun run serve
 
浏览器中打开即可

安装依赖
1、 npm i
2、 yarn
3、 bun i
第二种:使用图形化界面
vue ui
上述命令会打开一个浏览器窗口,并以图形化界面将你引导至项目创建的流程。 (官网图)

2 下载依赖
安装淘宝镜像(需使用cnpm命令)
npm install -g cnpm --registry=https://registry.npm.taobao.org

NPM镜像_NPM下载地址_NPM安装教程-阿里巴巴开源镜像站
相关其他命令
1、查看当前镜像源
npm config get registry
 2、设置淘宝镜像源(若需保持npm命令习惯且仅需加速下载,直接修改registry更简洁 )
npm config set registry https://registry.npmmirror.com/
3、删除淘宝镜像源
npm config delete registry https://registry.npmmirror.com
4、默认镜像(国外)
npm config set registry https://registry.npmjs.org
4、切换镜像源后,建议清空npm缓存以确保生效
npm cache clean --force
(1)一般安装
cnpm/npm i xxx -S
(2)指定版本安装
cnpm/npm install xxx@版本号 -S
yarn add xxx@版本号 -S
(3)卸载
cnpm/npm uninstall xxx -S
yarn remove echarts
 3 若使用yarn命令结果报错(补充)
error An unexpected error occurred: "https://registry.npm.taobao.org/@fullcalendar%2fbootstrap: certificate has expired".
原因:证书到期了
解决:
npm cache clean --forcenpm config set registry https://registry.npmmirror.com
查看 当前镜像源 npm config get registry 
 
更多推荐
 


所有评论(0)