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 fails to install fsevents while npm succeeds #5962

Closed
minusfive opened this issue Jun 9, 2018 · 48 comments
Closed

yarn fails to install fsevents while npm succeeds #5962

minusfive opened this issue Jun 9, 2018 · 48 comments
Assignees
Labels

Comments

@minusfive
Copy link

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
@ghost ghost assigned BYK Jun 9, 2018
@ghost ghost added the triaged label Jun 9, 2018
@minusfive minusfive changed the title yarn fails to install fsevents while npm succeeds yarn fails to install fsevents while npm succeeds Jun 9, 2018
@BYK
Copy link
Member

BYK commented Jun 10, 2018

This is not yarn. It is AWS giving you a 404 from one of the install scripts running through fsevents. Looks like it goes through with npm because it was cached. If you try again with Yarn it may go through if this was a temporary server issue.

If not, then if you clear your npm cache and try again, that will also fail.

@BYK BYK closed this as completed Jun 10, 2018
@justin808
Copy link

justin808 commented Jun 13, 2018

I cleared both my yarn and node caches and I still get this error, yarn 1.6.0, node 10.1.0.

@jadchaar
Copy link

jadchaar commented Jun 14, 2018

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.

@jacksonhardy
Copy link

jacksonhardy commented Jun 18, 2018

I'm also having this issue, but only in directories that I set up with yarn create react-app [dir name] a few months ago.

If I create a new directory, i.e. for a different project, then I have no issues.

I'm using node 10.4.1 npm 6.1.0 yarn 1.7.0

I've tried running yarn upgrade but it triggers the same error w/ fsevents.

Anyone have any other ideas?

@esausilva
Copy link

esausilva commented Jun 19, 2018

@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

@MaxGraey
Copy link

Same issue on MacOS with node 10.5.0

@wilomgfx
Copy link

same issue with node 10.6.0 (macOs mojave beta 2)

@xuqingkuang
Copy link

Just downgrade the node to LTS 8.11.3 will works fine.

Every nodejs version lower than 10 should work.

@joshkg
Copy link

joshkg commented Jul 19, 2018

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.

@regiondavid
Copy link

use node 8.11 fixed

@esausilva
Copy link

The latest Yarn version fixes this. I haven't had this issues since updating and now I'm running Node 10.x

@Macilias
Copy link

Macilias commented Sep 3, 2018

I can not run yarn upgrade because it says:

error Outdated lockfile. Please run yarn install and try again.

when run yarn install it says:

error /Users/username/Programming/github.com/projectname/node_modules/node-zopfli: Command failed.
Exit code: 1

Seams like an mission impossible to me

@esausilva
Copy link

@Macilias you can delete the lock file and yarn will re-create it when running yarn install

@Macilias
Copy link

Macilias commented Sep 4, 2018

while true, yarn fails to recreate it once the file has been deleted, so the project stays in an unusable state ... We could not figure out how to update it to get into a usable state.

@ghost
Copy link

ghost commented Sep 25, 2018

I've cleared the cache and that works perfectly. try yarn cache clean

@maximelafarie
Copy link

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
...

@BYK
Copy link
Member

BYK commented Oct 26, 2018

Try running yarn global add node-gyp first and then try installing fsevents. Btw. which version of yarn are you using? In recent versions this shouldn't be necessary.

@underwindfall
Copy link

underwindfall commented Oct 30, 2018

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

@shrinathaithal
Copy link

Mine worked with following -

rm yarn.lock
yarn cache clean
yarn install

@yuhr
Copy link

yuhr commented Nov 3, 2018

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 😭

@evannorstrand
Copy link

This issue is happening for me as well.

yarn 1.12.1
node 11.0.0
macOS 1.14 Mojave.

The above fixes did not work for me.

@ambroisemaupate
Copy link

Same for me:

  • yarn 1.12.3
  • node v11.1.0
  • macOs 10.14.1

The above fixes did not work for me.

@leegee
Copy link

leegee commented Nov 30, 2018

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

@rld2drkw
Copy link

rld2drkw commented Dec 2, 2018

In my case, it was helpful to downgrade python to 2.7 using pyenv.

node-gyp would require python 2.7, not 3.x.

infiniteluke pushed a commit to fourkitchens/scrummy-react-dom that referenced this issue Jan 3, 2019
Addresses #39. I had to `rm yarn.lock` and `yarn install` and  due to a upstream issue in yarnpkg/yarn#5962 (comment)
@mmontag
Copy link

mmontag commented May 12, 2019

Another one fixed here by downgrading node from v12.2.0 to LTS v10.15.3.

@coreyward
Copy link

coreyward commented May 13, 2019

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"
}

@rolandoalvarado
Copy link

yarn upgrade solves my issue.

@byzyk
Copy link

byzyk commented Jul 8, 2019

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.

@aindong
Copy link

aindong commented Jul 9, 2019

I recently experienced this issue and yarn upgrade did solve the problem. Thank you!

@coreyward
Copy link

@aindong Did you see the comment above yours?

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.

You can do yarn upgrade on your mac, which will install fsevents, but then when you go to deploy to a Linux server where fsevents is not available (it's macOS-specific) it will fail.

@egel
Copy link

egel commented Aug 1, 2019

If you still have a problem with fsevents you probably need to upgrade the packages which you're using. They may have old dependencies which in the end uses an old version of fsevents. In my case, it was nodemod -> yarn upgrade nodemon

How to find them:

  1. yarn list
  2. search backward for all occurrences of fsevents
  3. update those packages (best to latest versions). yarn upgrade <package>
  4. remove local node_modules rm -rf node_modules
  5. clean yarn cache yarn cache clean
  6. reinstall packages yarn

@coreyward
Copy link

@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.

@andreluisjunqueira
Copy link

i solved node-pre-gyp ERR! not ok by changing node version to 10.2.1, yarn 1.21.1, and now is working fine !

@chuxolatouz
Copy link

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

@bmorrical-ICC
Copy link

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

@jmlavoier
Copy link

It worked for me xcode-select --install

@sneko
Copy link

sneko commented Jun 26, 2020

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 🥰

@JeffreyCA
Copy link

I solved this by deleting package-lock.json and re-running npm install.

@dario-pon
Copy link

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

This solved for me! I had to run it few times as well.
Thanks

@jacobgoh101
Copy link

yarn upgrade works, but it also forced me to upgrade all packages, which is not ideal for me.

What I had to do was, run yarn why fsevents.

through yarn why, it was stated that nodemon, gulp, jest was using fsevents.

I upgraded/removed these 3 packages and things works for me again.

@gerbus
Copy link

gerbus commented Dec 16, 2020

Yep same. Did yarn why fsevents, which pointed to nodemon. Upgraded nodemon and then everything was cool.

ryu1kn added a commit to ryu1kn/whatsdone that referenced this issue Dec 28, 2020
topheman added a commit to topheman/nextjs-movie-browser that referenced this issue Sep 30, 2021
topheman added a commit to topheman/nextjs-movie-browser that referenced this issue Oct 2, 2021
topheman added a commit to topheman/nextjs-movie-browser that referenced this issue Oct 2, 2021
@abdullahceylan
Copy link

Removing yarn.lock and running yarn again solved my issue.

@dep
Copy link

dep commented Jun 15, 2022

In my case, I solved this by adding resolutions for those two dependencies in my package.json:

"resolutions": {
    ...
    "**/fsevents": "2.3.2",
    "**/node-pre-gyp": "0.17.0",
    ...
}

Testing with a fresh rm -rf node_modules and yarn install built without errors.

@brizer
Copy link

brizer commented Feb 17, 2023

yarn global add node-gyp

it is works for me. thanks.

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

No branches or pull requests