Ghost local installation 3/5 stuck fetching packages taking over an hour to install

I have spent several hours attempting to resolve the error ( being stuck when fetching packages for over an hour ) that occurs during the local installation of Ghost for theme development. Despite trying to uninstall and reinstall Ghost-cli and clearing the cache, I am still encountering the same issue.

I have run the ghost install local --verbose command to provide the complete output,
I encountered this after an hour of waiting and there do not appear to be any issues with permissions.

verbose 1928.4537175 Performing "GET" request to "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz".
verbose 1928.7724517 Performing "GET" request to "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-7.1.2.tgz".
verbose 1929.6917894 Performing "GET" request to "https://registry.yarnpkg.com/@sinonjs/text-encoding/-/text-encoding-0.7.2.tgz".
verbose 1930.586262 Performing "GET" request to "https://registry.yarnpkg.com/just-extend/-/just-extend-4.2.1.tgz".
verbose 1938.8595999 Performing "GET" request to "https://registry.yarnpkg.com/supertest/-/supertest-6.3.3.tgz".
verbose 1938.9252633 Performing "GET" request to "https://registry.yarnpkg.com/superagent/-/superagent-8.0.6.tgz".
verbose 1940.6855879 Performing "GET" request to "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz".
verbose 1940.9984405 Performing "GET" request to "https://registry.yarnpkg.com/formidable/-/formidable-2.1.1.tgz".
verbose 1941.751453 Performing "GET" request to "https://registry.yarnpkg.com/dezalgo/-/dezalgo-1.0.4.tgz".
verbose 1941.869984 Performing "GET" request to "https://registry.yarnpkg.com/hexoid/-/hexoid-1.0.0.tgz".
verbose 1941.9572615 Performing "GET" request to "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz".
verbose 1943.0371314 Performing "GET" request to "https://registry.yarnpkg.com/tmp/-/tmp-0.2.1.tgz".
verbose 1943.0629532 Performing "GET" request to "https://registry.yarnpkg.com/toml/-/toml-3.0.0.tgz".
verbose 1944.2799716 Performing "GET" request to "https://registry.yarnpkg.com/@tryghost/html-to-mobiledoc/-/html-to-mobiledoc-2.0.0.tgz".
verbose 1944.2924696 Performing "GET" request to "https://registry.yarnpkg.com/@tryghost/kg-parser-plugins/-/kg-parser-plugins-3.0.0.tgz".
verbose 1944.5081479 Performing "GET" request to "https://registry.yarnpkg.com/@tryghost/mobiledoc-kit/-/mobiledoc-kit-0.12.4-ghost.1.tgz".
verbose 1945.2512668 Performing "GET" request to "https://registry.yarnpkg.com/@tryghost/kg-clean-basic-html/-/kg-clean-basic-html-3.0.0.tgz".
verbose 1946.7437406 Performing "GET" request to "https://registry.yarnpkg.com/mobiledoc-dom-renderer/-/mobiledoc-dom-renderer-0.7.0.tgz".
verbose 1947.0222057 Performing "GET" request to "https://registry.yarnpkg.com/mobiledoc-text-renderer/-/mobiledoc-text-renderer-0.4.0.tgz".
info There appears to be trouble with your network connection. Retrying...
verbose 2001.9585829 Performing "GET" request to "https://registry.yarnpkg.com/@stdlib/stats/-/stats-0.0.13.tgz".


--------------- stderr ---------------
warning ghost@5.33.6: The engine "cli" appears to be invalid.
warning Resolution field "@elastic/elasticsearch@8.5.0" is incompatible with requested version "@elastic/elasticsearch@8.6.0"
warning Resolution field "moment@2.24.0" is incompatible with requested version "moment@^2.29.1"
warning Resolution field "moment@2.24.0" is incompatible with requested version "moment@2.29.1"
warning Resolution field "moment@2.24.0" is incompatible with requested version "moment@^2.27.0"
warning Resolution field "moment-timezone@0.5.23" is incompatible with requested version "moment-timezone@^0.5.31"
warning Resolution field "moment@2.24.0" is incompatible with requested version "moment@2.29.4"
warning Resolution field "moment@2.24.0" is incompatible with requested version "moment@2.29.4"
warning Resolution field "moment-timezone@0.5.23" is incompatible with requested version "moment-timezone@0.5.34"
warning Resolution field "moment@2.24.0" is incompatible with requested version "moment@2.29.1"
warning Resolution field "moment@2.24.0" is incompatible with requested version "moment@2.29.3"
warning Resolution field "@tryghost/logging@2.4.0" is incompatible with requested version "@tryghost/logging@2.3.6"
warning Resolution field "moment-timezone@0.5.23" is incompatible with requested version "moment-timezone@^0.5.33"
warning Resolution field "moment@2.24.0" is incompatible with requested version "moment@2.27.0"
warning Resolution field "@tryghost/logging@2.4.0" is incompatible with requested version "@tryghost/logging@2.3.6"
warning Resolution field "@tryghost/logging@2.4.0" is incompatible with requested version "@tryghost/logging@2.3.6"
warning Resolution field "moment@2.24.0" is incompatible with requested version "moment@^2.29.1"
error An unexpected error occurred: "https://registry.yarnpkg.com/is-whitespace-character/-/is-whitespace-character-1.0.4.tgz: getaddrinfo EAI_AGAIN registry.yarnpkg.com".

I thought it was a network problem But my network speed is at least 7 megabytes per second.
After removing the ‘node_modules’ folder, clearing the yarn and npm cache, and running ‘yarn install’ again, everything appeared to be fine, but I am still encountering the same error during installation. The debug output has not provided any insights into the cause of the problem and it appears that this error has been encountered by others before.

This appears to be a networking issue. By removing node_modules, all progress was lost, so it’s no surprise it was slow the second time, too.

The problem may be on the remote end, not yours, so try again.

The process of fetching packages has consistently been slow, taking more than an hour. When I lose patience, I am forced to restart it again.

Restarting might help, depending on why the networking is stuck, just keep what’s been downloaded so far.