yarn fails to install fsevents while npm succeeds

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

yarn fails to install fsevents (404s), while npm succeeds

If the current behavior is a bug, please provide the steps to reproduce.

With yarn

❯ git clone git@github.com:minusfive/ember-cli-sass-variables-export.git
❯ cd ember-cli-sass-variables-export
❯ yarn
yarn install v1.7.0
[1/5] 🔍  Validating package.json...
[2/5] 🔍  Resolving packages...
[3/5] 🚚  Fetching packages...
[-------------------------------------------------------------------------------------------------------------------------------------------------------] 0/1048(node:5246) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
[4/5] 🔗  Linking dependencies...
warning " > eslint-plugin-node@6.0.1" has unmet peer dependency "eslint@>=3.1.0".
[5/5] 📃  Building fresh packages...
[-/3] ⠁ waiting...
[2/3] ⠂ fsevents
warning Error running install script for optional dependency: "/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents: Command failed.
Exit code: 1
Command: node install
Arguments:
Directory: /Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@0.6.39
node-pre-gyp info using node@10.4.0 | darwin | x64
node-pre-gyp info check checked for \"/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node\" (not found)
node-pre-gyp http GET https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.3/fse-v1.1.3-node-v64-darwin-x64.tar.gz
node-pre-gyp http 404 https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.3/fse-v1.1.3-node-v64-darwin-x64.tar.gz
node-pre-gyp ERR! Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.3/fse-v1.1.3-node-v64-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for fsevents@1.1.3 and node@10.4.0 (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp http 404 status code downloading tarball https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.3/fse-v1.1.3-node-v64-darwin-x64.tar.gz
node-pre-gyp ERR! Tried to download(undefined): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.3/fse-v1.1.3-node-v64-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for fsevents@1.1.3 and node@10.4.0 (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp http Connection closed while downloading tarball file
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.2
gyp info using node@10.4.0 | darwin | x64
gyp info ok
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.2
gyp info using node@10.4.0 | darwin | x64
gyp info ok
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.2
gyp info using node@10.4.0 | darwin | x64
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.2
gyp info using node@10.4.0 | darwin | x64
gyp http GET https://nodejs.org/download/release/v10.4.0/node-v10.4.0-headers.tar.gz
gyp http GET https://nodejs.org/download/release/v10.4.0/node-v10.4.0-headers.tar.gz
gyp http 200 https://nodejs.org/download/release/v10.4.0/node-v10.4.0-headers.tar.gz
gyp http 200 https://nodejs.org/download/release/v10.4.0/node-v10.4.0-headers.tar.gz
gyp http GET https://nodejs.org/download/release/v10.4.0/SHASUMS256.txt
gyp http GET https://nodejs.org/download/release/v10.4.0/SHASUMS256.txt
gyp http 200 https://nodejs.org/download/release/v10.4.0/SHASUMS256.txt
gyp http 200 https://nodejs.org/download/release/v10.4.0/SHASUMS256.txt
gyp info spawn /usr/bin/python
gyp info spawn args [ '/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/minusfive/.node-gyp/10.4.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/minusfive/.node-gyp/10.4.0',
gyp info spawn args   '-Dnode_gyp_dir=/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/minusfive/.node-gyp/10.4.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info spawn /usr/bin/python
gyp info spawn args [ '/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/minusfive/.node-gyp/10.4.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/minusfive/.node-gyp/10.4.0',
gyp info spawn args   '-Dnode_gyp_dir=/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/minusfive/.node-gyp/10.4.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info ok
gyp info ok
gyp info it worked if it ends with ok
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.2
gyp info using node@10.4.0 | darwin | x64
gyp info using node-gyp@3.6.2
gyp info using node@10.4.0 | darwin | x64
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  SOLINK_MODULE(target) Release/.node
  SOLINK_MODULE(target) Release/.node
  CXX(target) Release/obj.target/fse/fsevents.o
  CXX(target) Release/obj.target/fse/fsevents.o
In file included from ../fsevents.cc:6:
../../nan/nan.h:839:18: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
    return node::MakeCallback(
                 ^
/Users/minusfive/.node-gyp/10.4.0/include/node/node.h:171:1: note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED(\"Use MakeCallback(..., async_context)\",
^
/Users/minusfive/.node-gyp/10.4.0/include/node/node.h:88:20: note: expanded from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                   ^
In file included from ../fsevents.cc:6:
../../nan/nan.h:854:18: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
    return node::MakeCallback(
                 ^
/Users/minusfive/.node-gyp/10.4.0/include/node/node.h:164:1: note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED(\"Use MakeCallback(..., async_context)\",
^
/Users/minusfive/.node-gyp/10.4.0/include/node/node.h:88:20: note: expanded from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                   ^
In file included from ../fsevents.cc:6:
../../nan/nan.h:869:18: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
    return node::MakeCallback(
                 ^
/Users/minusfive/.node-gyp/10.4.0/include/node/node.h:157:1: note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED(\"Use MakeCallback(..., async_context)\",
^
/Users/minusfive/.node-gyp/10.4.0/include/node/node.h:88:20: note: expanded from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                   ^
In file included from ../fsevents.cc:6:
../../nan/nan.h:839:18: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
    return node::MakeCallback(
                 ^
/Users/minusfive/.node-gyp/10.4.0/include/node/node.h:171:1: note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED(\"Use MakeCallback(..., async_context)\",
^
/Users/minusfive/.node-gyp/10.4.0/include/node/node.h:88:20: note: expanded from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                   ^
In file included from ../fsevents.cc:6:
../../nan/nan.h:854:18: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
    return node::MakeCallback(
                 ^
/Users/minusfive/.node-gyp/10.4.0/include/node/node.h:164:1: note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED(\"Use MakeCallback(..., async_context)\",
^
/Users/minusfive/.node-gyp/10.4.0/include/node/node.h:88:20: note: expanded from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                   ^
In file included from ../fsevents.cc:6:
../../nan/nan.h:869:18: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
    return node::MakeCallback(
                 ^
/Users/minusfive/.node-gyp/10.4.0/include/node/node.h:157:1: note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED(\"Use MakeCallback(..., async_context)\",
^
/Users/minusfive/.node-gyp/10.4.0/include/node/node.h:88:20: note: expanded from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                   ^
In file included from ../fsevents.cc:6:
../../nan/nan.h:1648:31: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
    return scope.Escape(node::MakeCallback(
                              ^
/Users/minusfive/.node-gyp/10.4.0/include/node/node.h:171:1: note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED(\"Use MakeCallback(..., async_context)\",
^
/Users/minusfive/.node-gyp/10.4.0/include/node/node.h:88:20: note: expanded from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                   ^
In file included from ../fsevents.cc:6:
../../nan/nan.h:1648:31: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
    return scope.Escape(node::MakeCallback(
                              ^
/Users/minusfive/.node-gyp/10.4.0/include/node/node.h:171:1: note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED(\"Use MakeCallback(..., async_context)\",
^
/Users/minusfive/.node-gyp/10.4.0/include/node/node.h:88:20: note: expanded from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                   ^
In file included from ../fsevents.cc:85:
../src/methods.cc:14:12: warning: 'Call' is deprecated [-Wdeprecated-declarations]
  handler->Call(3, argv);
           ^
../../nan/nan.h:1567:3: note: 'Call' has been explicitly marked deprecated here
  NAN_DEPRECATED inline v8::Local<v8::Value>
  ^
../../nan/nan.h:98:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
                                       ^
In file included from ../fsevents.cc:85:
../src/methods.cc:14:12: warning: 'Call' is deprecated [-Wdeprecated-declarations]
  handler->Call(3, argv);
           ^
../../nan/nan.h:1567:3: note: 'Call' has been explicitly marked deprecated here
  NAN_DEPRECATED inline v8::Local<v8::Value>
  ^
../../nan/nan.h:98:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
                                       ^
5 warnings generated.
5 warnings generated.
  SOLINK_MODULE(target) Release/fse.node
rm: cannot remove './Release/.deps/Release/obj.target/fse/fsevents.o.d.raw': No such file or directory
make: *** [Release/obj.target/fse/fsevents.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Darwin 17.6.0
gyp ERR! command \"/usr/local/Cellar/node/10.4.0/bin/node\" \"/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/node-gyp/bin/node-gyp.js\" \"build\" \"--fallback-to-build\" \"--module=/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node\" \"--module_name=fse\" \"--module_path=/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64\"
gyp ERR! cwd /Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents
gyp ERR! node -v v10.4.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/Cellar/node/10.4.0/bin/node /Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node --module_name=fse --module_path=/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:961:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:5)
node-pre-gyp ERR! System Darwin 17.6.0
node-pre-gyp ERR! command \"/usr/local/Cellar/node/10.4.0/bin/node\" \"/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp\" \"install\" \"--fallback-to-build\"
node-pre-gyp ERR! cwd /Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents
node-pre-gyp ERR! node -v v10.4.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/Cellar/node/10.4.0/bin/node /Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node --module_name=fse --module_path=/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64' (1)
  COPY /Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node
  TOUCH Release/obj.target/action_after_build.stamp
✨  Done in 157.31s.

With npm

❯ rm -rf node_modules
❯ npm install

> fsevents@1.2.4 install /Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents
> node install

[fsevents] Success: "/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile

> node-sass@4.9.0 install /Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/node-sass
> node scripts/install.js

Cached binary found at /Users/minusfive/.npm/node-sass/4.9.0/darwin-x64-64_binding.node

> spawn-sync@1.0.15 postinstall /Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/spawn-sync
> node postinstall


> node-sass@4.9.0 postinstall /Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/node-sass
> node scripts/build.js

Binary found at /Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/node-sass/vendor/darwin-x64-64/binding.node
Testing binary
Binary is fine
added 1317 packages from 645 contributors and audited 40932 packages in 32.386s

What is the expected behavior?

It should work?

Please mention your node.js, yarn and operating system version.

❯ node -v
v10.4.0

❯ npm -v
6.1.0

❯ yarn -v
1.7.0

❯ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.13.5
BuildVersion:	17F77

Author: Fantashit

23 thoughts on “yarn fails to install fsevents while npm succeeds

  1. I am getting this issue as well on Node 10.4.1.

    Update: it turns out the version of Webpack we are using depends on an older version of fsevents that is not compatible with Node ^10.

    Try running yarn upgrade.

  2. @sisterjones I’m having the same issue in my Mac with CRA and is driving me crazy (Node 10.4.1). It works in Windows though, but I have Node 9.11.1 in Windows

    Edit: I downgraded to Node 9.11.12 and everything works fine now. Hopefully a fix to this is released soon

  3. I experienced this issue when upgrading my Ember project to version 3.2, which requires node 10+. The only thing that helped was yarn upgrade.

  4. The same with yarn cache clean on Mojave OS. 😕
    Output:

    ...
    gyp ERR! cwd /Users/username/.../app/node_modules/fsevents
    gyp ERR! node -v v10.12.0
    gyp ERR! node-gyp -v v3.6.2
    gyp ERR! not ok
    ...
    
  5. I have the same issue, just like @maximelafarie
    try running yarn global add node-gyp did not save me. @BYK

    yarn version :1.2.1
    node version :v10.13.0
    npm version :6.4.1
    macOS version : Mojave
    

    EDIT
    For those who have the same issue like me, I have to downgrade node version to skip reinstalling fsevents. So I gonna paste the final environment of my workspace

    yarn version :1.2.3
    node version :8.12.0
    
  6. Same error as @maximelafarie, with yarn global add some package comes with fsevents, but yarn cache clean succeeds.

    • yarn 1.12.1
    • node 11.0.0
    • macOS 10.14 Mojave

    Edit
    The issue seems to be resolved by running yarn global add node-gyp and then yarn global remove node-gyp … I’m not sure what happened, anyway everything’s working without error for me 😭

  7. Me too…. why is this issue closed?

    09:13:23 $ node -v
    v11.2.0
    09:18:10 $ yarn -v
    1.12.3
    09:18:12 $ sw_vers
    ProductName:	Mac OS X
    ProductVersion:	10.13.6
    BuildVersion:	17G65
    
  8. On Mac OS X with versions:

    $ sw_vers
    ProductName:	Mac OS X
    ProductVersion:	10.13.6
    BuildVersion:	17G3025
    $ node -v
    v11.12.0
    $ yarn -v
    1.15.2

    The following helped (and yes npm succeeded before):

    # xcode was erroring with brew
    sudo xcode-select --switch /Applications/Xcode.app
    sudo xcodebuild -license accept
    
    # fresh new node modules
    rm -rf node_modules
    
    # solution @shrinathaithal (these commands alone did not help though)
    rm yarn.lock
    yarn cache clean
    yarn install
  9. I had the same issue as this running the following:

    > sw_vers
    ProductName:    Mac OS X
    ProductVersion: 10.14.4
    BuildVersion:   18E226
    > node -v
    v12.1.0
    

    Running yarn cache clean followed by using the LTS version of Node.js at v10.15.3 as opposed to the current version fixed it.

    I’m nvm to juggle multiple Node.js versions.

  10. There was recently an issue with fsevents causing it to be incompatible with Node 12. This was resolved and released in fsevents v1.2.9. If you have dependencies that rely on fsevents you can tell Yarn to use version 1.2.9 for each of them using resolutions:

    Add this to your package.json file, then re-run yarn (or yarn install):

    "resolutions": {
      "fsevents": "1.2.9"
    }
  11. Please note that Yarn is going to treat packages listed in resolutions (as suggested by @coreyward) as non-optional because of #6834 bug. Because of the bug, your build might succeed on macOS but will fail on Linux.

  12. @egel This is overkill. Most of the dependencies that reference fsevents as a dependency are going to have it declared like ~> 0.2.7 or >= 0.2.7, which allow you install version 0.2.9 while still meeting the requirements. Thus the solution of using resolutions, which allow you to have Yarn resolve a dependency declaration (e.g. fsevents ~> 0.2.7 or fsevents) to a specific version.

    As a note, this works great for most dependencies, but because fsevents is platform specific and previous versions of Yarn didn’t allow resolutions to be optional, when Yarn would be run in an environment that doesn’t use fsevents (like Linux), dependency installation would fail. I believe this has been fixed in the latest version of Yarn, but if not a workaround is to add the resolutions, re-run yarn install, and then commit only your yarn.lock file and discard the resolution declaration in your package.json file. This results in the correct version of fsevents being utilized going forward, but since resolutions are not used the optional flag is not clobbered.

    In any case, running commands like rm -rf node_modules and yarn cache clean are ineffective when you do not have an issue with corrupted packages. Rebuilding the entire cache over the network is slow, too, doing this unnecessarily is not recommended.

  13. I don’t know if someone still have this issue. I solved it doing
    yarn install --check-files
    I had to do it a couple of times

    I did it on OSX 10.13 High Sierra

  14. Works for me:

    yarn upgrade
    revert changes in package.json (if needed for your situation)
    rm -rf node_modules
    rm yarn.lock
    yarn
    commit newly created lock file
    
  15. In my case and since I have Babel I was not able to use:

    "resolutions": {
      "**/**/fsevents": "^1.2.9"
    }
    

    due to multiple nested dependencies using different version of it.

    But I succeeded using:

      "resolutions": {
        "**/**/chokidar": "^2.1.8"
      }
    

    Roughly, Babel team wants to keep compatibility with Node 6 that’s why it still use the old fsevents, but they plan to migrate in Babel v8.

    Hope it helps 🥰

Comments are closed.