Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yarn 2 breaks application #5740

Closed
abenerd opened this issue Jan 27, 2020 · 3 comments
Closed

Yarn 2 breaks application #5740

abenerd opened this issue Jan 27, 2020 · 3 comments

Comments

@abenerd
Copy link
Contributor

abenerd commented Jan 27, 2020

Describe the bug
Yarn 2 was released recently and the project appears to be incompatible with it.
I think we should either fix the version to yarn 1 (now legacy) or upgrade to yarn 2

To Reproduce

  • Clone dev.to repository
  • Run yarn version with yarn 2 or
  • Run yarn install with yarn 2

Expected behavior
Yarn to work

Desktop (please complete the following information):

  • OS: macOS Catalina
  • Browser:
  • Version: 10.15.2

Additional context

>>> yarn install
...
➤ YN0001: │ Error: fsevents@patch:fsevents@npm%3A2.0.7#builtin<compat/fsevents>::version=2.0.7&hash=e8cd9e: Cannot apply hunk #1
    at c (/Users/me/.yarn/releases/yarn-berry.js:58:888149)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async /Users/me/.yarn/releases/yarn-berry.js:58:890280
    at async o (/Users/me/.yarn/releases/yarn-berry.js:58:887432)
    at async Object.t.applyPatchFile (/Users/me/.yarn/releases/yarn-berry.js:58:890253)
    at async t.PatchFetcher.patchPackage (/Users/me/.yarn/releases/yarn-berry.js:58:887187)
    at async /Users/me/.yarn/releases/yarn-berry.js:58:886444
    at async /Users/me/.yarn/releases/yarn-berry.js:36:569449
    at async /Users/me/.yarn/releases/yarn-berry.js:36:569392
...
➤ YN0013: │ yargs-parser@npm:4.2.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ yargs-parser@npm:5.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ yargs-parser@npm:7.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ yargs-parser@npm:9.0.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ yargs@npm:11.1.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ yargs@npm:12.0.5 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ yargs@npm:3.10.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ yargs@npm:6.6.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ yargs@npm:7.1.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ yargs@npm:8.0.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0000: └ Completed in 53.64s
➤ YN0000: Failed with errors in 1.28m
>>> yarn version
Internal Error: dev.to@workspace:.: This package doesn't seem to be present in your lockfile; try to make an install to update your resolutions
    at t.RunInstallPleaseResolver.getCandidates (/Users/me/.yarn/releases/yarn-berry.js:36:863677)
    at t.MultiResolver.getCandidates (/Users/me/.yarn/releases/yarn-berry.js:24:41320)
    at /Users/me/.yarn/releases/yarn-berry.js:36:581640
    at /Users/me/.yarn/releases/yarn-berry.js:36:857805
    at new Promise (<anonymous>)
    at e.exports (/Users/me/.yarn/releases/yarn-berry.js:36:857787)
    at i (/Users/me/.yarn/releases/yarn-berry.js:24:91764)
    at /Users/me/.yarn/releases/yarn-berry.js:24:91837
    at /Users/me/.yarn/releases/yarn-berry.js:24:91880
    at new Promise (<anonymous>)
@rhymes
Copy link
Contributor

rhymes commented Jan 27, 2020

Hi @abenettt, thanks for the info!

According to the installation guide npm install yarn still installs Yarn 1, so on that side we're okay:

➜  devto git:(master) npm install yarn -g 
/Users/rhymes/.nvm/versions/node/v12.14.1/bin/yarnpkg -> /Users/rhymes/.nvm/versions/node/v12.14.1/lib/node_modules/yarn/bin/yarn.js
/Users/rhymes/.nvm/versions/node/v12.14.1/bin/yarn -> /Users/rhymes/.nvm/versions/node/v12.14.1/lib/node_modules/yarn/bin/yarn.js
+ yarn@1.21.1
added 1 package in 1.964s 

We might want to go over the documentation and the various parts where we mention Yarn and specify Yarn 1.

As Yarn 2 is largely incompatible with Yarn 1 and it seems to be generating issues with various packages I don't think we should rush into the upgrade anyway.

Let's fix the version to Yarn 1 in the meantime and we can keep an eye on Yarn 2.

Also, I'm quite sure the Rails webpack plugin we use it's not compatible with Yarn 2 so we couldn't upgrade anyway.

Would you be interested in going over the various places we mention Yarn and make sure we're telling people to use Yarn 1?

grepping results for yarn around the code
➜  devto git:(master) rg yarn | rg -v "yarn.lock"
Dockerfile:ENV PATH=/root/.yarn/bin:$PATH
Dockerfile:        yarn
Dockerfile:RUN yarn install && yarn check --integrity
README.md:- [Yarn](https://yarnpkg.com/): please refer to their
README.md:  [installation guide](https://yarnpkg.com/en/docs/install).
docker-entrypoint.sh:echo "alias devto-setup='cd /usr/src/app/ && gem install bundler && bundle install --jobs 20 --retry 5 && yarn install && yarn check --integrity && bin/setup'" >> ~/.bashrc
docker-entrypoint.sh:	echo ">    devto-setup   : Does the gem/yarn dependency installation, along with database setup"
package.json:    "api-docs:serve": "yarn redoc-cli serve docs/api_v0.yml --options.pathInMiddlePanel --options.jsonSampleExpandLevel=all --options.menuToggle -t docs/api_template.hbs --watch"
bin/update:  system('bin/yarn')
bin/setup:  system('bin/yarn')
bin/yarn:    exec "yarnpkg", *ARGV
bin/yarn:    $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
docs/readme.md:yarn global add gitdocs
docs/contributing.md:yarn global add gitdocs
docs/contributing_api.md:yarn api-docs:serve
config/environments/production.rb:  config.webpacker.check_yarn_integrity = false
config/environments/development.rb:def yarn_integrity_enabled?
config/environments/development.rb:  config.webpacker.check_yarn_integrity = yarn_integrity_enabled?
docs/tests/preact-tests.md:yarn test
docs/tests/code-coverage.md:yarn test
docs/getting-started/committing.md:`yarn --force` or `npm install --no-cache`. For some reason, the post-install
docs/getting-started/committing.md:script of husky does not run when the package is pulled from yarn or npm's
docs/getting-started/start-app.md:`yarn install` before starting the app.
docs/installation/mac.md:Please refer to their [installation guide](https://yarnpkg.com/en/docs/install).
docs/installation/linux.md:  guide](https://yarnpkg.com/en/docs/install#debian-stable) (recommended).
docs/installation/linux.md:  run `npm install -g yarn` to install Yarn.
docs/installation/linux.md:issues while `yarn` is installing packages. If so, you'll need to [install
docs/installation/windows.md:curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
docs/installation/windows.md:echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
docs/installation/windows.md:sudo apt-get update && sudo apt-get install yarn
docs/installation/windows.md:Make sure that Yarn is installed with `yarn -v`
docs/installation/docker.md:1. run `docker-compose run web yarn install`
  

@abenerd
Copy link
Contributor Author

abenerd commented Jan 27, 2020

I can do that, sure.

@maestromac
Copy link
Contributor

Technically Resolved with #5786

@rhymes rhymes mentioned this issue Mar 24, 2020
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants