yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.42k stars 2.72k forks source link

Cannot install any packages anymore #2365

Open mariotacke opened 7 years ago

mariotacke commented 7 years ago

Do you want to request a feature or report a bug? Bug/Question

What is the current behavior? I was happily using v0.17.10 and then upgraded to v0.18.1 via self-update which broke yarn installs for me. At first I thought it had to do with node-pre-gyp but then I tried creating a brand new project and just install eslint which failed. I tried other packages and yarn seems to choke on them as well. I completely cleaned out any cached npm packages, removed my .npmrc, and re-installed node. No dice. Curiously, using npm works fine (npm install eslint --save-dev). I'm not sure where else to look... :/

λ yarn add eslint --dev
yarn add v0.18.1
info No lockfile found.
[1/4] Resolving packages...
error Couldn't find package "eslint" on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

It appears that something is up with the connection to yarn/npm:

λ yarn info react --verbose
yarn info v0.18.1
verbose Performing "GET" request to "https://registry.yarnpkg.com/react".
verbose Request "https://registry.yarnpkg.com/react" finished with status code 500.
error Received invalid response from npm.
Done in 60.24s.
  1. Uh oh.

If the current behavior is a bug, please provide the steps to reproduce. yarn add eslint --dev

What is the expected behavior? I expect yarn to install eslint as dev dependency and create a yarn.lock file.

Please mention your node.js, yarn and operating system version. node: v6.9.2 npm: v3.10.9 yarn: v0.18.1 os: Windows 10

Daniel15 commented 7 years ago

Are you using a proxy server at all?

Try completely uninstalling then reinstalling Yarn. self-update never worked properly which is why it has been removed until a better version is implemented.

Pinpickle commented 7 years ago

I got a similar problem today as well, trying to deploy to Heroku using Yarn.

-----> Building dependencies
       Installing node modules (yarn)
       yarn install v0.18.1
       [1/4] Resolving packages...
       error Couldn't find package "react-redux" on the "npm" registry.
       info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Sometimes it got past the resolving packages stage only to run into another 500 error.

-----> Building dependencies
       Installing node modules (yarn)
       yarn install v0.18.1
       [1/4] Resolving packages...
       [2/4] Fetching packages...
       error An unexpected error occurred: "https://registry.yarnpkg.com/pushstate-server/-/pushstate-server-2.1.0.tgz: Request failed "500 Internal Server Error"".
       info If you think this is a bug, please open a bug report with the information provided in "/tmp/build_1ca248ab7dc32e80c7ffc34a230b6d56/hackcambridge-hc-applications-0d8bb39/yarn-error.log".
       info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

The culprit package changes for every attempted build. I had to revert to npm.

I also started seeing it on a docker container I'm running in development, which is on Yarn v0.16.1.

Only started seeing this today. Happy 2017!

mariotacke commented 7 years ago

@Daniel15 Not using a proxy at all. I re-installed yarn from the .msi installer. Same thing. npm installs work fine. What threw me off is the fact that it returns a 500. Maybe the yarn to npm registry proxy has issues? Is the yarn registry hosted on CloudFlare; could it have to do with the leap second issues many sites encountered?

I just ran it again (2017 now) and it works fine now. Maybe it was fixed internally.

bstro commented 7 years ago

I am seeing this bug as well. It happens with different packages each time, as @Pinpickle stated.

bobmoff commented 7 years ago

I have the same problem when trying to deploy to Heroku.

error An unexpected error occurred: "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz: Request failed "502 Bad Gateway""

It fails on different modules on each try for me as well