简体   繁体   中英

npm Fetch Failed. Error Code 504

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

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 :)

Try to execute the command below:

npm config set registry http://registry.npmjs.org/

That will get packages npm install over HTTP.

Sometimes you also get a 504 error if you have an incompatible npm version.

npm install -g npm@6.13.4

The npm versions v3, v6 and v8 are partly incompatible. So just try to install a different npm version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM