npm,yarn,pnpm包管理器

刪除緩存

npm cache clean --force

yarn cache clean

pnpm store prune

鏡像切換
npm

npm config set registry https://registry.npm.taobao.org (?切換淘寶鏡像)

npm config set registry https://registry.npmjs.org (換回來)

npm config get registry (查看當(dāng)前鏡像)

yarn

yarn config set registry https://registry.npmjs.org

yarn config set registry https://registry.npm.taobao.org

yarn config get registry

代理設(shè)置取消

npm

npm config set proxy=http://127.0.0.1:8087

npm config set https-proxy=http://127.0.0.1:8087

npm config delete proxy

npm config delete https-proxy

yarn

yarn config set proxy http://XXX

yarn config set https-proxy http://XXX

yarn config delete proxy

yarn config delete https-proxy

查看yarn安裝包的本地路徑

yarn global dir

npm全局安裝目錄

一般是安裝在了 C:\Users\Administrator\AppData\Roaming\npm

常見問題:
多個(gè)版本的包會(huì)導(dǎo)致應(yīng)用的不同部分在使用不同的 Vue 與對(duì)應(yīng)包實(shí)例,進(jìn)而引發(fā)如?useXXX() is called without provider?之類的錯(cuò)誤。
你可以通過執(zhí)行下列命令來更新到最新版本
pnpm dlx vp-update
yarn dlx vp-update
npx vp-update

最后編輯于
?著作權(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),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

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

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