yarn install throw error request failed \"404 Not found"
Asked Answered
C

6

16

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"
Cwmbran answered 19/3, 2018 at 19:42 Comment(2)
What is node version on your laptop? first of all you should update it on your pc. btw can you show line from packages.json with jest?Laskowski
I found a solution, I posted my answerCwmbran
C
51

I found a solution

yarn config set registry https://registry.npmjs.org
rm yarn.lock
yarn
Cwmbran answered 19/3, 2018 at 20:30 Comment(3)
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 lockInterlock
I had 404 issues with ...yarnpkg.com/serve-... and this solved it. Is Yarn falling apart after 2.0?Creath
Watch out, deleting yarn.lock can have unintended consequences as it can change the versions of packages installed. Don't casually run this on a real app without checking it doesn't introduce any issues.Damascus
D
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

Demigod answered 26/5, 2020 at 6:28 Comment(0)
L
2

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.

Loquat answered 6/8, 2020 at 11:34 Comment(0)
N
1

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.

Noni answered 8/1, 2020 at 22:14 Comment(0)
B
0

In my case if was invalid nodejs version. instalation was done for v20 and I try ot run in when active was v18.

nvm use v20
yarn # works fine
Blouson answered 26/5, 2024 at 5:58 Comment(0)
P
-7

following worked for npm

npm config set registry https://registry.npmjs.org
rm package.json && rm nodemodules
npm install
Poisson answered 21/6, 2022 at 12:8 Comment(2)
There's so much wrong with thisRainer
This is nearly a repeat of original answer https://mcmap.net/q/714208/-yarn-install-throw-error-request-failed-quot-404-not-found-quot and confusingly deletes the project's package.json file. It also incorrectly treats the path nodemodules as a file when it's a directory.Cottage

© 2022 - 2025 — McMap. All rights reserved.