yarn install throw error request failed \"404 Not found"

24,040

Solution 1

I found a solution

yarn config set registry https://registry.npmjs.org
rm yarn.lock
yarn

Solution 2

If you are getting this with a private npm package, make sure you are logged in with the proper user

run npm login

Docs

Solution 3

I had this problem today in CircleCI, turned out to be a cache problem:

yarn cache clean
yarn install

Actually I had to run yarn install twice but no idea why.

Solution 4

I had a similar issue, getting: An unexpected error occurred: "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.14.0.tgz: Request failed \"404 Not Found\"".

Deleting yarn.lock and running yarn may result in a lot of packages being upgraded, and possibly other configuration issues.

Instead, I just deleted the es-abstract resolution section from yarn.lock, e.g.:

es-abstract@^1.11.0, es-abstract@^1.5.1, es-abstract@^1.7.0:
  version "1.14.0"
  resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.14.0.tgz#f59d9d44278ea8f90c8ff3de1552537c2fd739b4"
  integrity sha512-lri42nNq1tIohUuwFBYEM3wKwcrcJa78jukGDdWsuaNxTtxBFGFkKUQ15nc9J+ipje4mhbQR6JwABb4VvawR3A==
  dependencies:
    es-to-primitive "^1.2.0"
    function-bind "^1.1.1"
    has "^1.0.3"
    has-symbols "^1.0.0"
    is-callable "^1.1.4"
    is-regex "^1.0.4"
    object-inspect "^1.6.0"
    object-keys "^1.1.1"
    string.prototype.trimleft "^2.0.0"
    string.prototype.trimright "^2.0.0"

and run yarn. This solved the issue with a minimal number of upgrades in yarn.lock.

Share:
24,040
Manspof
Author by

Manspof

Updated on August 22, 2021

Comments

  • Manspof
    Manspof over 2 years

    I have react native project that I worked on my laptop. when I transfer the project to my pc and run yarn install (I installed the some modules using yarn and some using npm) I get

    An unexpected error occurred: "https://registry.yarnpkg.com/jest/-/jest-23.0.0-alpha.0.tgz: Request failed \"404 Not Found\"".

    Yarn version on my pc and latop same

    1.5.1
    

    npm version my pc and latop same

    5.4.1
    

    node version

    v 7.9.0
    

    in addition i get warning when run yarn install on my project

    warning You are using Node "7.9.0" which is not supported and may encounter bugs or unexpected behavior. Yarn supports the following semver range: "^4.8.0 || ^5.7.0 || ^6.2.2 || >=8.0.0"
    
  • rbenvenuto
    rbenvenuto over 5 years
    I was having the same problem: error An unexpected error occurred: "https://registry.yarnpkg.com/src-map/-/src-map-0.5.7.tgz: Request failed \"404 Not Found\"". And this solution worked for me. This seems like a problem with yarn's dependencies lock
  • Design by Adrian
    Design by Adrian about 4 years
    I had 404 issues with ...yarnpkg.com/serve-... and this solved it. Is Yarn falling apart after 2.0?