npm install too slow and hangs on compute engine

Hello

I tried to run this command on linux on compute engine in order to install a package. Tried with different node and npm versions

`npm install @wordpress/scripts --save-dev`

but it gets stuck at fetchMetadata: and become very slow and eventually just hangs .

I have tried different config settings as per my research

I have tried these below settings

npm config set registry http://registry.npmjs.org/ --global
npm cache clear --force
npm set maxsockets 3

npm config set strict-ssl true

Also I have tried downgrading to npm 6 and tried fresh install for nvm, npm and node and then tried to run

npm install @wordpress/scripts --save-dev

But none of the above settings / solution worked . Running the above npm install command is very slow and doesn’t not complete installation . It get stuck at different points in different tries .

On local the same command works and package is installed in less than a minute.

Is it a networking issue / memory issue or something else going on? I have been having this issue for last 5-6 days . Can someone please help in this regard?

1 Like

Hello @myusername ,

Welcome to Google Cloud Community!

I’m afraid you are right. It could be due to poor network connectivity between your CE instance and npm registry.

Please make sure that your network connection is stable and also ensure that you are using the latest stable versions of npm to avoid performance issues or bugs from the earlier versions.

Thanks

1 Like