berry: [Bug] Cannot install fsevents - Cannot apply hunk #1

  • I’d be willing to implement a fix

Describe the bug

Some package requires fsevents to be fetched, but it fails.

➤ YN0000: ┌ Fetch step
➤ YN0013: │ fsevents@patch:fsevents@npm%3A2.0.7#builtin<compat/fsevents>::version=2.0.7&hash=e8cd9e can't be found in the cache and will be fetched from the disk
➤ YN0001: │ Error: fsevents@patch:fsevents@npm%3A2.0.7#builtin<compat/fsevents>::version=2.0.7&hash=e8cd9e: Cannot apply hunk #1
    at c (...\yarn\bin\yarn.js:111:195461)
    at process._tickCallback (internal/process/next_tick.js:68:7)
➤ YN0000: └ Completed in 1.24s
➤ YN0000: Failed with errors in 8.69s

To Reproduce

await expect(packageJsonAndInstall({
  dependencies: {
    [`fsevents`]: `2.0.7`
  }
})).resolves.toBeTruthy();

Environment if relevant (please complete the following information):

  • OS: Windows 10 (build 18362.592)
  • Node 10.16.0
  • Yarn 2.0.0-rc.24

Additional context

I suspect that this error may be related to PR https://github.com/yarnpkg/berry/pull/692

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 11
  • Comments: 21 (4 by maintainers)

Most upvoted comments

Upgrading yarn to the version on master works for me

# fail with fsevents: cannot apply hunk
yarn set version berry
yarn add jest

# success
yarn set version from sources
yarn add jest

Any updates? Still cannot upgrade CRA to Yarn 2 🤦‍♂️

➤ YN0066: │ fsevents@patch:fsevents@npm%3A2.2.0#builtin<compat/fsevents>::version=2.2.0&hash=127e8e: Cannot apply hunk #1 (set enableInlineHunks for details)

The 2.2.1 version of fsevents appeared to be the problem, so I updated the version in yarn.lock to the following and it solved

before:

fsevents@^2.1.2, fsevents@^2.1.3:
  version "2.2.1"
  resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.2.1.tgz#1fb02ded2036a8ac288d507a65962bd87b97628d"
  integrity sha512-bTLYHSeC0UH/EFXS9KqWnXuOl/wHK5Z/d+ghd5AsFMYN7wIGkUCOJyzy88+wJKkZPGON8u4Z9f6U4FdgURE9qA==

fsevents@~2.1.2:
  version "2.1.2"
  resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.2.tgz#4c0a1fb34bc68e543b4b82a9ec392bfbda840805"
  integrity sha512-R4wDiBwZ0KzpgOWetKDug1FZcYhqYnUYKtfZYt4mD5SBz76q0KR4Q9o7GIPamsVPGmW3EYPPJ0dOOjvx32ldZA==

after:

fsevents@~2.1.2, fsevents@^2.1.2, fsevents@^2.1.3:
  version "2.1.2"
  resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.2.tgz#4c0a1fb34bc68e543b4b82a9ec392bfbda840805"
  integrity sha512-R4wDiBwZ0KzpgOWetKDug1FZcYhqYnUYKtfZYt4mD5SBz76q0KR4Q9o7GIPamsVPGmW3EYPPJ0dOOjvx32ldZA==

Hm indeed - the patch doesn’t apply cleanly on 2.0.0 to 2.0.7, which have a very different structure than the later releases:

https://cdn.jsdelivr.net/npm/fsevents@2.0.7/fsevents.js https://cdn.jsdelivr.net/npm/fsevents@2.1.2/fsevents.js

I guess you can’t simply upgrade fsevents?