1 安装node.js
安装node.js https://nodejs.org/zh-cn/download/prebuilt-installer
2 常见错误处理
npm ERR! code CERT_HAS_EXPIRED
npm ERR! errno CERT_HAS_EXPIRED
npm ERR! request to https://registry.npm.taobao.org/yocto-queue/download/yocto-queue-0.1.0.tgz?cache=0&sync_timestamp=1606290282107&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fyocto-queue%2Fdownload%2Fyocto-queue-0.1.0.tgz failed, reason: certificate has expired
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/admin/.npm/_logs/2024-10-08T09_48_03_525Z-debug-0.log
1、npm cache clean --force 清除缓存
2、npm 更换淘宝镜像
// 查看当前的镜像设置
npm config get registry
// 然后,将npm设置为淘宝镜像:
npm config set registry https://registry.npm.taobao.org/
3、 关闭证书验证
npm config set strict-ssl false
4、运行项目 npm run serve
> nretail-central-business-web@3.0.0 serve
> vue-cli-service --host 0.0.0.0 serve
报错的是因为cls没有安装
5、安装cls npm install -g @vue/cli
6、npm install 报错
npm ERR! Cannot read properties of null (reading 'pickAlgorithm')
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/admin/.npm/_logs/2024-10-09T10_57_42_151Z-debug-0.log
7、尝试使用pnpm进行安装,pnpm是国内的源 更容易安装 还是报错
8、最后叫同事将他的依赖打包压缩给我