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

Unable to update mocha to 8.3.1: fsevents@patch - Cannot apply hunk #1 #4602

Closed
4 tasks done
DJ-Glock opened this issue Mar 10, 2021 · 4 comments
Closed
4 tasks done

Comments

@DJ-Glock
Copy link

DJ-Glock commented Mar 10, 2021

Prerequisites

  • Checked that your issue hasn't already been filed by cross-referencing issues with the faq label
  • Checked next-gen ES issues and syntax problems by using the same environment and/or transpiler configuration without Mocha to ensure it isn't just a feature that actually isn't supported in the environment in question or a bug in your code.
  • 'Smoke tested' the code to be tested by running it outside the real test suite to get a better sense of whether the problem is in the code under test, your usage of Mocha, or Mocha itself
  • Ensured that there is no discrepancy between the locally and globally installed versions of Mocha. You can find them with: node node_modules/.bin/mocha --version(Local) and mocha --version(Global). We recommend that you not install Mocha globally.

Description

I'm trying to update mocha from version 8.2.1 to 8.3.1. Mocha is installed as dev dependency.

Steps to Reproduce

Set version 8.3.1 in package.json and run yarn or use upgrade-interactive or use yarn add mocha --dev.

Expected behavior:
Mocha 8.3.1 should be installed.

Actual behavior: [What actually happens]
Error occurred:
➤ YN0066: │ fsevents@patch:fsevents@npm%3A2.3.2#builtin<compat/fsevents>::version=2.3.2&hash=127e8e: Cannot apply hunk #1 (set enableInlineHunks for details)
image

Versions

  • The output of mocha --version and node node_modules/.bin/mocha --version: 8.2.1
  • The output of node --version: 12.18.3
  • Your operating system
    • name and version: Windows 10
    • architecture (32 or 64-bit): 64-bit
  • Your shell (e.g., bash, zsh, PowerShell, cmd): Powershell
  • Your browser and version (if running browser tests): -
  • Any third-party Mocha-related modules (and their versions): yarn 2.3.3.
  • Any code transpiler (e.g., TypeScript, CoffeeScript, Babel) being used (and its version): -

I searched for this error and found many issues from 2020, but all of them were resolved somehow. So not sure why it occurred for me especially on Windows.

@juergba
Copy link
Contributor

juergba commented Mar 10, 2021

@DJ-Glock I also use Windows 10 and the installation with NPM runs successfully. I just get the warning:

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

I have no idea why it doesn't work with Yarn. Doing some googling I get the impression it's a Yarn issue.

@juergba
Copy link
Contributor

juergba commented Mar 10, 2021

maybe something like: yarn install --ignore-optional

@DJ-Glock
Copy link
Author

@juergba you might be right about optional. It looks like the chain is: mocha requires chokidar and chokidar requires fsevents, but optionally.

I have no idea why yarn 2 tries to install optional dependency and flag --ignore-optional does not work as per this issue.
I'll raise another issue for yarn team.

Thanks.

@DJ-Glock
Copy link
Author

Update: it was a yarn issue. It looks like issue was fixed in yarn 2.4.1. We updated yarn to 2.4.0 - issue was in place, but after ipdating yarn to 2.4.1 everything is fine.

Hope this will help someone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants