PLCNEXT#Node-redでNodeインストールエラーのトラブル対処法

こちらはpodmanでNode-redを使用するときNode Installできない問題に関しての解決方法です。

Error-1 getaddrinfo EAI_AGAIN

まず最初はgetaddrinfo EAI_AGAIN registry.npmjs.orgのエラーです。

request to https://registry.npmjs.org/node-red-contrib-mqtt-broker failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org

2023-04-17T05:40:28.220Z Install : node-red-contrib-mqtt-broker 0.2.9

2023-04-17T05:40:28.577Z npm install –no-audit –no-update-notifier –no-fund –save –save-prefix=~ –production –engine-strict node-red-contrib-mqtt-broker@0.2.9
2023-04-17T05:40:36.334Z [err] npm
2023-04-17T05:40:36.352Z [err] 
2023-04-17T05:40:36.354Z [err] WARN
2023-04-17T05:40:36.361Z [err]  config
2023-04-17T05:40:36.364Z [err]  production Use `–omit=dev` instead.
2023-04-17T05:42:04.924Z [err] npm
2023-04-17T05:42:04.927Z [err] 
2023-04-17T05:42:04.930Z [err] ERR!
2023-04-17T05:42:04.933Z [err] 
2023-04-17T05:42:04.939Z [err] code
2023-04-17T05:42:04.942Z [err]  EAI_AGAIN
2023-04-17T05:42:04.948Z [err] npm
2023-04-17T05:42:04.950Z [err]  ERR!
2023-04-17T05:42:04.954Z [err]  syscall
2023-04-17T05:42:04.957Z [err]  getaddrinfo
2023-04-17T05:42:04.957Z [err] npm
2023-04-17T05:42:04.961Z [err] ERR!
2023-04-17T05:42:04.964Z [err]  errno EAI_AGAIN
2023-04-17T05:42:05.004Z [err] npm ERR!
2023-04-17T05:42:05.009Z [err]  request to https://registry.npmjs.org/node-red-contrib-mqtt-broker failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org
2023-04-17T05:42:05.045Z [err]
2023-04-17T05:42:05.050Z [err] npm ERR!
2023-04-17T05:42:05.055Z [err]  A complete log of this run can be found in:
2023-04-17T05:42:05.055Z [err] npm ERR!     /data/.npm/_logs/2023-04-17T05_40_35_680Z-debug-0.log
2023-04-17T05:42:05.110Z rc=1

Solutuon

元のImagesとContainerを削除し、–network=hostをパラメータとして入れてください。

podman run -it -p 1880:1880 –network=host -v node_red_data:/data –name mynered nodered/node-red

Reference Link

https://stackoverflow.com/questions/65925304/eai-again-when-running-npm-install-in-docker-container

Error-2 Hostname/IP does not match certificate’s altnames

次はこちらの証明証に合わないエラーです。

Hostname/IP does not match certificate’s altnames: Host: registry.npmjs.org. is not in the cert’s altnames

2023-04-17T08:15:19.897Z Install : node-red-contrib-opcua 0.2.304

2023-04-17T08:15:20.503Z npm install –no-audit –no-update-notifier –no-fund –save –save-prefix=~ –production –engine-strict node-red-contrib-opcua@0.2.304
2023-04-17T08:15:28.242Z [err] npm
2023-04-17T08:15:28.257Z [err] 
2023-04-17T08:15:28.261Z [err] WARN
2023-04-17T08:15:28.264Z [err]  config
2023-04-17T08:15:28.267Z [err]  production Use `–omit=dev` instead.
2023-04-17T08:21:29.303Z [err] npm
2023-04-17T08:21:29.309Z [err] 
2023-04-17T08:21:29.313Z [err] ERR!
2023-04-17T08:21:29.316Z [err] 
2023-04-17T08:21:29.324Z [err] code ERR_TLS_CERT_ALTNAME_INVALID
2023-04-17T08:21:29.328Z [err] npm
2023-04-17T08:21:29.332Z [err] ERR! errno ERR_TLS_CERT_ALTNAME_INVALID
2023-04-17T08:21:29.389Z [err] npm
2023-04-17T08:21:29.394Z [err] ERR! request to https://registry.npmjs.org/node-red-contrib-opcua failed, reason: Hostname/IP does not match certificate’s altnames: Host: registry.npmjs.org. is not in the cert’s altnames: DNS:default.ssl.fastly.net, DNS:fastly.com, DNS:*.a.ssl.fastly.net, DNS:*.hosts.fastly.net, DNS:*.global.ssl.fastly.net, DNS:*.fastly.com, DNS:a.ssl.fastly.net, DNS:purge.fastly.net, DNS:mirrors.fastly.net, DNS:control.fastly.net, DNS:tools.fastly.net
2023-04-17T08:21:29.435Z [err]
2023-04-17T08:21:29.440Z [err] npm ERR!
2023-04-17T08:21:29.454Z [err]  A complete log of this run can be found in:
2023-04-17T08:21:29.454Z [err] npm ERR!     /data/.npm/_logs/2023-04-17T08_15_27_707Z-debug-0.log
2023-04-17T08:21:29.534Z rc=1

Solution

まずregistry.npmjs.orgをPingしてください。

ping registry.npmjs.org

Hosts Fileを修正します。

sudo nano /etc/hosts

104.16.109.30   registry.npmjs.orgを追記し、CPUを再起動してください。                                                          

127.0.0.1 localhost.localdomain           localhost
104.16.109.30   registry.npmjs.org


# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
127.0.1.1 axcf2152

Reference Link

https://stackoverflow.com/questions/48158939/getaddrinfo-eai-again-registry-npmjs-org80

https://stackoverflow.com/questions/52128460/hostname-ip-doesnt-match-certificates-altnames

https://stackoverflow.com/questions/52128460/hostname-ip-doesnt-match-certificates-altnames

Footer_Basic

Please Support some devices for my blog

Amazon Gift List

Find ME

Twitter:@3threes2
Email:soup01threes*gmail.com (* to @)
YoutubeChannel:https://www.youtube.com/channel/UCQ3CHGAIXZAbeOC_9mjQiWQ

シェアする

  • このエントリーをはてなブックマークに追加

フォローする