清除cache缓存

yarn cache clean

查看最新版本

npm show <package-name> version

查看包的可用版本

npm show <package-name> versions

lerna 指定镜像

lerna bootstrap --registry https://registry.npmmirror.com

阿里镜像

yarn install --registry https://registry.npmmirror.com

忽略脚本安装依赖

yarn install --registry https://registry.npmmirror.com --ignore--scripts

官方镜像

yarn install --registry https://registry.npmjs.org

设置node-sass镜像源

yarn config set sass_binary_site https://npm.taobao.org/mirrors/node-sass/

npm pnpm配置文件

registry=http://registry.npmmirror.com

yarn 配置文件

"registry" "http://registry.npmmirror.com"

peerDependencies

当一个包声明了 peerDependencies,它要求使用者在项目中安装符合指定版本要求的该依赖包,但并不会自动将其作为依赖项安装。这意味着开发者需要手动在项目中安装符合 peerDependency 版本要求的包,以确保项目可以正确地使用这个第三方包。

yarn忽略脚本安装依赖

yarn --ignore--scripts

yarn安装依赖显示网络超时

【error Error: getaddrinfo ENOTFOUND registry.nlark.com at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:72:26)】

解决 将registry.nlark.com 替换为 registry.npmmirror.com

npm rebuild node-sass

依赖安装遇到 node-sass 与node版本问题,yarn安装时失败,手动执行脚本。