'npm gyp errors - How to resolve?

I have been facing the following errors with yarn install, and not sure why. How to fix them and what is the reason for them to pop up?

node version: 12 npm version: 6.14.15 yarn version: 1.22.17 OS: Mac OS Catalina

[-/8] ⠐ waiting...
[2/8] ⠐ fsevents
[-/8] ⠐ waiting...
[7/8] ⠐ phantomjs-prebuilt
error /Users/1645020/Workspace/Sherloc/HK MCY/rdc-ui-app-brz-hk/node_modules/iltorb: Command failed.
Exit code: 1
Command: node ./scripts/install.js || node-gyp rebuild
Arguments: 
Directory: /Users/1645020/Workspace/Sherloc/HK MCY/rdc-ui-app-brz-hk/node_modules/iltorb
Output:
info looking for local prebuild @ prebuilds/iltorb-v2.3.2-node-v72-darwin-x64.tar.gz
info looking for cached prebuild @ /Users/1645020/.npm/_prebuilds/https-github.com-MayhemYDG-iltorb-releases-download-v2.3.2-iltorb-v2.3.2-node-v72-darwin-x64.tar.gz
http request GET https://github.com/MayhemYDG/iltorb/releases/download/v2.3.2/iltorb-v2.3.2-node-v72-darwin-x64.tar.gz
WARN install getaddrinfo ENOTFOUND github.com
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | x64
gyp info find Python using Python version 2.7.16 found at "/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python"
gyp http GET https://nodejs.org/download/release/v12.22.8/node-v12.22.8-headers.tar.gz
gyp WARN install got an error, rolling back install
gyp ERR! configure error 
gyp ERR! stack Error: This is most likely not a problem with node-gyp or the package itself and
gyp ERR! stack is related to network connectivity. In most cases you are behind a proxy or have bad 
gyp ERR! stack network settings.
gyp ERR! stack     at Request.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/install.js:171:21)
gyp ERR! stack     at Request.emit (events.js:314:20)
gyp ERR! stack     at Request.onRequestError (/usr/local/lib/node_modules/npm/node_modules/request/request.js:881:8)
gyp ERR! stack     at ClientRequest.emit (events.js:314:20)
gyp ERR! stack     at TLSSocket.socketErrorListener (_http_client.js:427:9)
gyp ERR! stack     at TLSSocket.emit (events.js:314:20)
gyp ERR! stack     at emitErrorNT (internal/streams/destroy.js:92:8)
gyp ERR! stack     at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
gyp ERR! stack     at processTicksAndRejections (internal/process/task_queues.js:84:21)
gyp ERR! System Darwin 19.6.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/1645020/Workspace/Sherloc/HK MCY/rdc-ui-app-brz-hk/node_modules/iltorb
gyp ERR! node -v v12.22.8
Failed to execute '/usr/local/bin/node /Users/1645020/Workspace/Sherloc/HK MCY/rdc-ui-app-brz-hk/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/1645020/Workspace/Sherloc/HK MCY/rdc-ui-app-brz-hk/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64/fse.node --module_name=fse --module_path=/Users/1645020/Workspace/Sherloc/HK MCY/rdc-ui-app-brz-hk/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64 --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)"


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source