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文件后再尝试看看,说不准就能解决你的问题。

相关内容

热门资讯

信息共享辅助!百盛娱乐辅助多功... 信息共享辅助!百盛娱乐辅助多功能AI软件,百盛娱乐确实存在有辅助软件百盛娱乐能透视中分为三种模型:百...
安装程序教程开挂!天游大厅开挂... 安装程序教程开挂!天游大厅开挂多功能AI技巧,天游大厅一贯存在有开挂技巧1、每一步都需要思考,不同水...
一起来讨论辅助器!超稳新城辅助... 一起来讨论辅助器!超稳新城辅助器多功能AI脚本,超稳新城总是有辅助器脚本1、超稳新城破解器简单,超稳...
发现一款辅助!新果汁大厅辅助多... 发现一款辅助!新果汁大厅辅助多功能AI方法,新果汁大厅一直有辅助方法1、下载好新果汁大厅正确养号方法...
玩家必看科普外挂!红莲外挂多功... 玩家必看科普外挂!红莲外挂多功能AI脚本,红莲总是真的有外挂脚本运红莲辅助工具,进入游戏界面。进入红...
WPK下载透视挂,wpk透视是... WPK下载透视挂,wpk透视是真的假的,微扑克本来真的有透视挂攻略1)wpk透视是真的假的免费钻石:...
WPK链接透视,智星德州辅助译... WPK链接透视,智星德州辅助译码插件靠谱吗,智星菠萝德州本来真的有透视工具1、完成智星德州辅助译码插...
WPK私人局开挂,德扑之星透视... WPK私人局开挂,德扑之星透视辅助软件是真的吗,wpk竟然是有开挂工具1、下载好德扑之星透视辅助软件...
WPK透视辅助器,pokerw... WPK透视辅助器,pokerworld破解版下载,德州扑克原来真的有辅助器教程该软件可以轻松地帮助玩...
WPK靠谱开挂,哈糖大菠萝免费... WPK靠谱开挂,哈糖大菠萝免费辅助器,WePoKer真是存在有开挂软件1、金币登录送、破产送、升级送...