安装
如果要安装指定版本可以使用nvm,但nvm install会报错查找不到指定版本 可采用如下方法
## 查看可安装的版本号
NVM_NODEJS_ORG_MIRROR=http://nodejs.org/dist nvm ls-remote
## 安装指定版本
NVM_NODEJS_ORG_MIRROR=http://nodejs.org/dist nvm install 18.16
使用
源
//使用阿里云 镜像源加速 NPM
npm config set registry https://npm.aliyun.com
//使用腾讯云镜像源加速 NPM
npm config set registry http://mirrors.cloud.tencent.com/npm/
//使用华为云 镜像源加速 NPM
npm config set registry https://mirrors.huaweicloud.com/repository/npm/
//返回npm 官方原始镜像
npm config set registry https://registry.npmjs.org/
常用命令
//查看配置
npm config ls
//设置配置
npm config set ···
//安装 删掉node_modules和package-lock.json在进行项目的安装
npm install
//存在依赖问题加 --legacy-peer-deps
npm install --legacy-peer-deps
//运行项目
npm run