yarn Error: getaddrinfo ENOTFOUND xxx 、npm ERR! xxx postinstall: `node lib/install.js 异常解决方法
创始人
2025-01-16 08:33:36
0

在yarn安装node项目依赖时提示  error Error: getaddrinfo ENOTFOUND registry.nlark.com at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:118:26)

详情如下:

[1/6] 🔍  Validating package.json... [2/6] 🔍  Resolving packages... [3/6] 🚚  Fetching packages... info There appears to be trouble with your network connection. Retrying... info There appears to be trouble with your network connection. Retrying... info There appears to be trouble with your network connection. Retrying... info There appears to be trouble with your network connection. Retrying... error Error: getaddrinfo ENOTFOUND registry.nlark.com     at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:118:26) info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

出现了类似这种 error Error: getaddrinfo ENOTFOUND xxx 的情况就是说对应的xxx地址找不到或者失效了。 导致这个的原因可能是你的当前项目中的  yarn.lock 文件中引用了一个已经失效的地址.

解决方法:  删除这个yarn.lock文件 或者其他  *.lock 文件后重新执行  yarn 或者npm install

如果你不使用yarn,直接改为 npm install 则可能会出现其他诡异的异常, 如:

m verb node v12.22.12
npm verb npm  v6.14.16
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mozjpeg@7.1.1 postinstall: `node lib/install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the mozjpeg@7.1.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm verb exit [ 1, true ]

yarn.lock中锁定了一个失效的地址,改用npm 不提示地址失效,直接来个 npm ERR! mozjpeg@7.1.1 postinstall: `node lib/install.js`  无法编译异常, 这个的根源还是这个 yarn.lock文件导致 编译mozjpeg的时候找不到依赖而编译失败, 而且神奇的是错误日志中居然没有任何和lock中锁定的失效地址registry.nlark.com 有关的信息......

所以,如果是 npm ERR! xxx postinstall: `node lib/install.js`  异常也可以尝试删除相关的 *.lock文件后再尝试看看,说不准就能解决你的问题。

相关内容

热门资讯

据监测!微乐小程序免费黑科技,... 据监测!微乐小程序免费黑科技,微乐麻辣自建房辅助视频(作弊器)法门教程(一贯真的是有挂)1、任何透视...
据玩家消息!拱趴大菠萝技巧,雀... 据玩家消息!拱趴大菠萝技巧,雀神广东智能插件,方针教程(有人有挂)-哔哩哔哩小薇(辅助器软件下载)致...
据相关数据显示!微乐小程序免费... 据相关数据显示!微乐小程序免费黑科技,如何下载微乐自建房黑科技入口(作弊器)教程书教程(原来是有挂)...
据相关数据显示!阿当比鸡辅助,... 据相关数据显示!阿当比鸡辅助,雀姬手机辅助脚本,秘籍教程(有挂秘笈)-哔哩哔哩1、操作简单,无需雀姬...
透视线上!微乐小程序黑科技,微... 透视线上!微乐小程序黑科技,微乐小程序透视辅助(透视)真是存在有挂(有挂功能)-哔哩哔哩在进入软件靠...
透视教你!微乐小程序免费黑科技... 透视教你!微乐小程序免费黑科技(外挂),微信微乐小程序辅助软件,教程经验(发现有挂)-哔哩哔哩1、许...
据玩家消息!微乐小程序免费黑科... 据玩家消息!微乐小程序免费黑科技,微乐贵阳捉鸡麻将辅助(作弊器)步骤教程(竟然真的有挂)1、下载好透...
近日!如何判断广东雀神挂件的质... 近日!如何判断广东雀神挂件的质量,智星德州辅助译码插件靠谱吗,学习教程(果真有挂)-哔哩哔哩1、智星...
透视解密!微乐小程序免费黑科技... 透视解密!微乐小程序免费黑科技(外挂),微乐自建房辅助,教程阶段(有挂技术)-哔哩哔哩1、玩家可以在...
透视规律!微乐小程序免费黑科技... 透视规律!微乐小程序免费黑科技,微乐小程序透视辅助(透视)竟然真的是有挂(有挂解惑)-哔哩哔哩1)辅...