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

相关内容

热门资讯

教会透视!wejoker私人辅... 教会透视!wejoker私人辅助软件,新玄龙插件(总算了解开挂辅助脚本);亲,有的,ai轻松简单,又...
详细透视"pokep... 详细透视"pokeplus脚本"开挂(透视)辅助神器(透视能赢有挂方针)>>您好:软件加136704...
关于透视!aapoker辅助工... 关于透视!aapoker辅助工具安全吗,红龙poker辅助平台(附辅助开挂安装);1.aapoker...
正版透视!wepokerplu... 正版透视!wepokerplus开挂,新众亿卡看底牌(玩家必备教程辅助开挂平台);新众亿卡看底牌软件...
推荐透视"wejok... wejoker私人辅助软件开挂教程视频分享装挂详细步骤在当今的网络游戏中,wejoker私人辅助软件...
曝光透视!wpk辅助器,wer... 曝光透视!wpk辅助器,werplan免费挂下载(附开挂辅助神器);一、werplan免费挂下载AI...
发现透视!wepoker到底有... 发现透视!wepoker到底有没有透视,友友联盟免费辅助器下载(辅助透视辅助开挂安装);1、不需要A...
详细透视"wepok... 详细透视"wepoker辅助器软件下载"开挂(透视)辅助软件(一分钟了解有挂解密);无需打开直接搜索...
科技透视!wepoker辅助是... 科技透视!wepoker辅助是真的假的,佛手在线大菠萝智能辅助器(附辅助开挂软件);详细佛手在线大菠...
必看透视"德州hhp... 必看透视"德州hhpoker是真的吗"开挂(透视)辅助安装(透视实锤有挂秘笈)【无需打开直接搜索加薇...