Vue项目开发注意事项

事项一:项目代码放在本地怎么运行起来

1、首先确定项目对应的node和npm版本

node下载地址  Index of /dist/icon-default.png?t=O83Ahttps://nodejs.org/dist/

node 与 npm版本对应关系

Node.js — Node.js Releases

2、node卸载的时候,会自动把对应的npm卸载掉

情况1:

node版本和对应的npm版本低,电脑上存在较高版本的npm,导致使用npm时,会提示node版本低,此时,先卸载低版本node,安装高版本对应的node;

然后使用 npm uninstall npm -g卸载高版本的npm。

然后安装需要的node版本即可,对应的npm会自动安装,不用再单独安装npm。

3、cnpm 及 淘宝镜像

cnpm安装
npm install -g cnpm --registry=https://registry.npmmirror.com
npm install -g cnpm --registry=http://mirrors.cloud.tencent.com/nodejs-release/

nodejs 12版本安装低版本cnpm
npm install cnpm@7.1.0 -g --registry=https://registry.npmmirror.com

淘宝镜像
npm config set registry https://registry.npmmirror.com

查看:
npm config list
npm config get registry

清除缓存:
npm cache clear --force

镜像源:
1、淘宝镜像: https://npmmirror.com/mirrors/npm/
2、cnpmjs镜像: https://registry.nlark.com
3、npm官方镜像: https://registry.npmjs.org

注:玩儿nodejs卡住了多按按空格!!!

参考 cnpm安装 最新淘宝镜像源_cnpm淘宝镜像-CSDN博客

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值