How to troubleshoot pods unable to connect to npm registry, No internet access?

I have a container which runs a ssh script on startup, Codes are below

set -e           # Stop on any error
npx sequelize-cli db:migrate:all  # Run migrations
npx sequelize-cli db:seed:all     # Preload initial data
exec "$@"        # Run the command as the main container process

So it requires to run npx. But from the container log I see the pod can not connect to the registry.

npm ERR! code EAI_AGAIN
npm ERR! errno EAI_AGAIN
npm ERR! request to failed, reason: getaddrinfo EAI_AGAIN

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-04-14T07_55_48_709Z-debug.log
Install for [ 'sequelize-cli@latest' ] failed with code 1

How do I troubleshoot this? AFAIK pods can connect to outside without any restriction.

Cluster information:

Kubernetes version: v1.20.1
Cloud being used: bare-metal (localhost minikube)
Installation method: CLI
Host OS: Ubuntu 20.04
CNI and version:
CRI and version: