Reputation:
I'm trying to implement this plugin called Share Button from npm my running https://github.com/carrot/share-button
. However after doing that and waiting around 5mins I get the following output:
npm ERR! fetch failed https://registry.npmjs.org/i/-/i-0.3.2.tgz
npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 504
⸨ ░░░░░░░░░░░░░░⸩ ⠇ fetchMetadata: WARN retry will retry, error on last attempt: Error: fetch failed with status code 504
Does anyone know why this would happen and a way to get round it? Thanks
Upvotes: 2
Views: 9600
Reputation: 1
npm registry -> It is the place where npm looks for information about the packages you asked for.
In layman language, we can say registry as public database where we can check available packages and download them.
Default npm public registry is found at https://registry.npmjs.org.
We can check the registry by running below command in your terminal: npm config get registry.
To resolve 504 gateway timeout. Execute below command: npm config set registry http://registry.npmjs.org/
Upvotes: 0
Reputation: 66
Sometimes you also get a 504 error if you have an incompatible npm version.
npm install -g [email protected]
The npm versions v3, v6 and v8 are partly incompatible. So just try to install a different npm version.
Upvotes: 0
Reputation: 304
If you tried
npm i --save-dev share-button
like me. Try using the github repo like that
npm install --save-dev carrot/share-button
That works without an error on my machine :)
Upvotes: 3
Reputation: 233
Try to execute the command below:
npm config set registry http://registry.npmjs.org/
That will get packages npm install over HTTP.
Upvotes: 1