npm常用命令
清除cache缓存
yarn cache clean查看最新版本
npm show <package-name> version查看包的可用版本
npm show <package-name> versionslerna 指定镜像
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.comyarn 配置文件
"registry" "http://registry.npmmirror.com"peerDependencies
当一个包声明了 peerDependencies,它要求使用者在项目中安装符合指定版本要求的该依赖包,但并不会自动将其作为依赖项安装。这意味着开发者需要手动在项目中安装符合 peerDependency 版本要求的包,以确保项目可以正确地使用这个第三方包。
yarn忽略脚本安装依赖
yarn --ignore--scriptsyarn安装依赖显示网络超时
【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安装时失败,手动执行脚本。
评论
匿名评论
隐私政策
你无需删除空行,直接评论以获取最佳展示效果