0

I am trying to install a package with npm, but I get this kind of error for any npm commands:

npm  -h
rcmd: getaddrinfo: nodename nor servname provided, or not known

This happens on a Mac (Ventura 13.1). npm 19.6.1 is installed via homebrew. I guess it is some kind of DNS issue, but I don't know how to get further. I couldn't find this specific error in many searches. Any ideas?

John Kitchin
  • 2,236
  • 1
  • 17
  • 25
  • Does this answer your question? [getaddrinfo: nodename nor servname provided, or not known](https://stackoverflow.com/questions/4132525/getaddrinfo-nodename-nor-servname-provided-or-not-known) – Anurag Srivastava Feb 19 '23 at 14:39
  • this is the problem I have, but nothing there helps me resolve it. I have tried restarting the terminal/using a different one to no avail. I have also tried setting different DNS servers, and that also seems to not have an effect. curl works to get REST API (I don't know what the npm one is, but others work). netstat and dig work fine from what I can see. – John Kitchin Feb 19 '23 at 15:55
  • it must be something in Mac, I just don't know what. If I run the node Docker image then npm in the image works fine. – John Kitchin Feb 19 '23 at 16:04

0 Answers0