前端開(kāi)發(fā)

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)打包壓縮給我

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容