0

I've successfully installed Gatsby, but then when I runned gatsby --version it gave this error:

zsh: command not found: gatsby

I've followed this thread: gatsby --version > -bash: gatsby: command not found but then when I reach the step of installing gatsby, it get stuck here:

enter image description here

What I've tried:

  1. Reinstall node
  2. Restart PC

I'm using a macOS Monterey. Any clues?

Marshall
  • 149
  • 4
  • 10

1 Answers1

0

I've found a solution. This issue was network related. Now, I'm not an expert on npm, but I'll do my best. It seems that these "hangs" happens when there're issues with the network, and npm cannot communicate with the registry, so it gets stuck.

  1. First I've runner: curl https://registry.npmjs.org --resolve 'registry.npmjs.org:443:[2606:4700::6810:1923]' and it gave me this error:

    curl: (7) Failed to connect to registry.npmjs.org port 443 after 4012 ms: Network is unreachable

  2. Then I've run this command: npm config set registry http://registry.npmjs.org/ to allow HTTP requests

  3. To check if it was connected: curl http://registry.npmjs.org --resolve 'registry.npmjs.org:443:[2606:4700::6810:1923]' and it worked not problems

  4. Finaly, I've installed Gatsby and version is: Gatsby CLI version: 5.7.0

If I've misunderstood something here, please let me know, I would love to learn more about this topic. Thank you!

Marshall
  • 149
  • 4
  • 10