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 (查看当前镜像)

yarn

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

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

yarn config get registry

代理设置取消

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

常见问题:
多个版本的包会导致应用的不同部分在使用不同的 Vue 与对应包实例,进而引发如 useXXX() is called without provider 之类的错误。
你可以通过执行下列命令来更新到最新版本
pnpm dlx vp-update
yarn dlx vp-update
npx vp-update

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容