1 安裝node.js
安裝node.js https://nodejs.org/zh-cn/download/prebuilt-installer
2 常見(jiàn)錯(cuò)誤處理
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 更換淘寶鏡像
// 查看當(dāng)前的鏡像設(shè)置
npm config get registry
// 然后,將npm設(shè)置為淘寶鏡像:
npm config set registry https://registry.npm.taobao.org/
3、 關(guān)閉證書(shū)驗(yàn)證
npm config set strict-ssl false
4、運(yùn)行項(xiàng)目 npm run serve
> nretail-central-business-web@3.0.0 serve
> vue-cli-service --host 0.0.0.0 serve
報(bào)錯(cuò)的是因?yàn)閏ls沒(méi)有安裝
5、安裝cls npm install -g @vue/cli
6、npm install 報(bào)錯(cuò)
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進(jìn)行安裝,pnpm是國(guó)內(nèi)的源 更容易安裝 還是報(bào)錯(cuò)
8、最后叫同事將他的依賴(lài)打包壓縮給我