fsevents: fsevents fails to build

macOS: 10.13.5 node: 10.4.1 yarn: 1.7.0 Xcode: 9.4.1

A continuation of https://github.com/strongloop/fsevents/issues/224#issuecomment-399264825:

[Giass-MacBook-Pro:studymelbourne-mobile gsklee$ yarn install
yarn install v1.7.0
(node:906) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
[1/4] πŸ”  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] πŸ”—  Linking dependencies...
warning " > babel-jest@21.2.0" has unmet peer dependency "babel-core@^6.0.0 || ^7.0.0-alpha || ^7.0.0-beta || ^7.0.0".
[4/4] πŸ“ƒ  Building fresh packages...
[1/2] ⠁ fsevents
warning Error running install script for optional dependency: "/Users/gsklee/Projects/GitHub/TodayDesign/studymelbourne-mobile/node_modules/fsevents: Command failed.
Exit code: 1
Command: node install
Arguments: 
Directory: /Users/gsklee/Projects/GitHub/TodayDesign/studymelbourne-mobile/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.1 | darwin | x64
node-pre-gyp info check checked for \"/Users/gsklee/Projects/GitHub/TodayDesign/studymelbourne-mobile/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.1 (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.1 (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.7.0
gyp info using node@10.4.1 | darwin | x64
gyp info it worked if it ends with ok
gyp info using node-gyp@3.7.0
gyp info using node@10.4.1 | darwin | x64
gyp infogyp info  ok 
ok 
gyp info it worked if it ends with ok
gyp info using node-gyp@3.7.0
gyp info using node@10.4.1 | darwin | x64
gyp info it worked if it ends with ok
gyp info using node-gyp@3.7.0
gyp info using node@10.4.1 | darwin | x64
gyp info spawn /usr/bin/python
gyp info spawn args [ '/Users/gsklee/.nvm/versions/node/v10.4.1/lib/node_modules/npm/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/gsklee/Projects/GitHub/TodayDesign/studymelbourne-mobile/node_modules/fsevents/build/config.gypi',
gyp infogyp  info spawn /usr/bin/python
spawn args   '-I',
gyp info spawn args [ '/Users/gsklee/.nvm/versions/node/v10.4.1/lib/node_modules/npm/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/gsklee/Projects/GitHub/TodayDesign/studymelbourne-mobile/node_modules/fsevents/build/config.gypi',
gyp info spawn args   '-I',
gypgyp info spawn args   '/Users/gsklee/.nvm/versions/node/v10.4.1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info  info spawn args   '/Users/gsklee/.nvm/versions/node/v10.4.1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gypspawn args   '-I',
 gypinfo  infospawn args spawn args   '/Users/gsklee/.node-gyp/10.4.1/include/node/common.gypi',
gyp   '/Users/gsklee/.node-gyp/10.4.1/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info  spawn argsinfo spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dlibrary=shared_library',
gyp   '-Dnode_root_dir=/Users/gsklee/.node-gyp/10.4.1',
 gyp infoinfo  spawn argsspawn args   '-Dnode_gyp_dir=/Users/gsklee/.nvm/versions/node/v10.4.1/lib/node_modules/npm/node_modules/node-gyp',
gyp   '-Dvisibility=default',
 gypinfo  infospawn args    '-Dnode_lib_file=/Users/gsklee/.node-gyp/10.4.1/<(target_arch)/node.lib',
spawn argsgyp   '-Dnode_root_dir=/Users/gsklee/.node-gyp/10.4.1',
 gypinfo  infospawn args    '-Dmodule_root_dir=/Users/gsklee/Projects/GitHub/TodayDesign/studymelbourne-mobile/node_modules/fsevents',
spawn argsgyp   '-Dnode_gyp_dir=/Users/gsklee/.nvm/versions/node/v10.4.1/lib/node_modules/npm/node_modules/node-gyp',
 gypinfo  infospawn args    '-Dnode_engine=v8',
spawn argsgyp   '-Dnode_lib_file=/Users/gsklee/.node-gyp/10.4.1/<(target_arch)/node.lib',
 gypinfo  infospawn args    '--depth=.',
spawn argsgyp   '-Dmodule_root_dir=/Users/gsklee/Projects/GitHub/TodayDesign/studymelbourne-mobile/node_modules/fsevents',
 gypinfo  infospawn args    '--no-parallel',
spawn argsgyp   '-Dnode_engine=v8',
 gypinfo  infospawn args    '--generator-output',
spawn argsgyp   '--depth=.',
 gypinfo  infospawn args    'build',
spawn argsgyp   '--no-parallel',
 gypinfo  infospawn args    '-Goutput_dir=.' ]
spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp infogyp ok  
info ok 
gyp info it worked if it ends with ok
gypgyp info using node-gyp@3.7.0
gyp info using node@10.4.1 | darwin | x64
 info it worked if it ends with ok
gyp info using node-gyp@3.7.0
gyp info using node@10.4.1 | darwin | x64
gypgyp  infoinfo  spawnspawn make
 make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
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.ccIn file included from ../fsevents.cc::66:
:
../../nan/nan.h:839:../../nan/nan.h18::839 :18: warningwarning: : 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]

    return node::MakeCallback(
                 ^
    return node::MakeCallback(
                 ^
/Users/gsklee/.node-gyp/10.4.1/include/node/node.h/Users/gsklee/.node-gyp/10.4.1/include/node/node.h::171171::11::  note: 'MakeCallback' has been explicitly marked deprecated herenote
: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED(\"Use MakeCallback(..., async_context)\",
^
NODE_DEPRECATED(\"Use MakeCallback(..., async_context)\",
^
/Users/gsklee/.node-gyp/10.4.1/include/node/node.h:/Users/gsklee/.node-gyp/10.4.1/include/node/node.h88:88::2020::  notenote: : expanded from macro 'NODE_DEPRECATED'expanded from macro 'NODE_DEPRECATED'

    __attribute__((deprecated(message))) declarator
                   ^
    __attribute__((deprecated(message))) declarator
                   ^
In file included from In file included from ../fsevents.cc:6../fsevents.cc:
:../../nan/nan.h6:
:../../nan/nan.h:854854::1818::  warningwarning: : 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
    return node::MakeCallback(
                 ^
    return node::MakeCallback(/Users/gsklee/.node-gyp/10.4.1/include/node/node.h
                 ^:
164:1: /Users/gsklee/.node-gyp/10.4.1/include/node/node.hnote:: 164'MakeCallback' has been explicitly marked deprecated here:
1: note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED(\"Use MakeCallback(..., async_context)\",
^
/Users/gsklee/.node-gyp/10.4.1/include/node/node.h:88:20: NODE_DEPRECATED(\"Use MakeCallback(..., async_context)\",note: 
expanded from macro 'NODE_DEPRECATED'
^
/Users/gsklee/.node-gyp/10.4.1/include/node/node.h:88:    __attribute__((deprecated(message))) declarator20
: 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/gsklee/.node-gyp/10.4.1/include/node/node.h:157:1: note: 'MakeCallback' has been explicitly marked deprecated here
In file included from ../fsevents.cc:6:
../../nan/nan.hNODE_DEPRECATED(\"Use MakeCallback(..., async_context)\",
:^869:18
: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]/Users/gsklee/.node-gyp/10.4.1/include/node/node.h
:88:20:     return node::MakeCallback(note
:                  ^expanded from macro 'NODE_DEPRECATED'

/Users/gsklee/.node-gyp/10.4.1/include/node/node.h:157:1    __attribute__((deprecated(message))) declarator:
                   ^
 note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED(\"Use MakeCallback(..., async_context)\",
^
/Users/gsklee/.node-gyp/10.4.1/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:1478:31: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
    return scope.Escape(node::MakeCallback(
                              ^
/Users/gsklee/.node-gyp/10.4.1/include/node/node.h:171:1: note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED(\"Use MakeCallback(..., async_context)\",
^
/Users/gsklee/.node-gyp/10.4.1/include/node/node.h:88:In file included from ../fsevents.cc:6:
20:../../nan/nan.h :note: expanded from macro 'NODE_DEPRECATED'1478:
31: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
    __attribute__((deprecated(message))) declarator
                   ^
    return scope.Escape(node::MakeCallback(
                              ^
/Users/gsklee/.node-gyp/10.4.1/include/node/node.h:171:1: note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED(\"Use MakeCallback(..., async_context)\",
^
/Users/gsklee/.node-gyp/10.4.1/include/node/node.h:88:20: note: expanded from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                   ^
4 warnings generated.
4 warnings generated.
rm: ./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/gsklee/.nvm/versions/node/v10.4.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262: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 \"/Users/gsklee/.nvm/versions/node/v10.4.1/bin/node\" \"/Users/gsklee/.nvm/versions/node/v10.4.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js\" \"build\" \"--fallback-to-build\" \"--module=/Users/gsklee/Projects/GitHub/TodayDesign/studymelbourne-mobile/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node\" \"--module_name=fse\" \"--module_path=/Users/gsklee/Projects/GitHub/TodayDesign/studymelbourne-mobile/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64\"
gyp ERR! cwd /Users/gsklee/Projects/GitHub/TodayDesign/studymelbourne-mobile/node_modules/fsevents
gyp ERR! node -v v10.4.1
gyp ERR! node-gyp -v v3.7.0
gyp ERR! not ok 
  SOLINK_MODULE(target) Release/fse.node
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/Users/gsklee/.nvm/versions/node/v10.4.1/bin/node /Users/gsklee/.nvm/versions/node/v10.4.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/gsklee/Projects/GitHub/TodayDesign/studymelbourne-mobile/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node --module_name=fse --module_path=/Users/gsklee/Projects/GitHub/TodayDesign/studymelbourne-mobile/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/gsklee/Projects/GitHub/TodayDesign/studymelbourne-mobile/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 \"/Users/gsklee/.nvm/versions/node/v10.4.1/bin/node\" \"/Users/gsklee/Projects/GitHub/TodayDesign/studymelbourne-mobile/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp\" \"install\" \"--fallback-to-build\"
node-pre-gyp ERR! cwd /Users/gsklee/Projects/GitHub/TodayDesign/studymelbourne-mobile/node_modules/fsevents
node-pre-gyp ERR! node -v v10.4.1
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok 
Failed to execute '/Users/gsklee/.nvm/versions/node/v10.4.1/bin/node /Users/gsklee/.nvm/versions/node/v10.4.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/gsklee/Projects/GitHub/TodayDesign/studymelbourne-mobile/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node --module_name=fse --module_path=/Users/gsklee/Projects/GitHub/TodayDesign/studymelbourne-mobile/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64' (1)
  COPY /Users/gsklee/Projects/GitHub/TodayDesign/studymelbourne-mobile/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node
  TOUCH Release/obj.target/action_after_build.stamp
gyp info ok"
✨  Done in 15.57s.

It fails to build in the end and as a result I couldn’t run my React Native project:

Scanning folders for symlinks in /Users/gsklee/Projects/GitHub/TodayDesign/studymelbourne-mobile/node_modules (29ms)
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                                                                              β”‚
β”‚  Running Metro Bundler on port 8081.                                         β”‚
β”‚                                                                              β”‚
β”‚  Keep Metro running while developing on any JS projects. Feel free to        β”‚
β”‚  close this tab and run your own Metro instance if you prefer.               β”‚
β”‚                                                                              β”‚
β”‚  https://github.com/facebook/react-native                                    β”‚
β”‚                                                                              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Looking for JS files in
   /Users/gsklee/Projects/GitHub/TodayDesign/studymelbourne-mobile 


Metro Bundler ready.

Loading dependency graph...(node:4499) UnhandledPromiseRejectionWarning: Error: `fsevents` unavailable (this watcher can only be used on Darwin)
    at new FSEventsWatcher (/Users/gsklee/Projects/GitHub/TodayDesign/studymelbourne-mobile/node_modules/sane/src/fsevents_watcher.js:41:11)
    at createWatcher (/Users/gsklee/Projects/GitHub/TodayDesign/studymelbourne-mobile/node_modules/metro/node_modules/jest-haste-map/build/index.js:621:23)
    at Array.map (<anonymous>)
    at HasteMap._watch (/Users/gsklee/Projects/GitHub/TodayDesign/studymelbourne-mobile/node_modules/metro/node_modules/jest-haste-map/build/index.js:769:44)
    at _buildPromise._buildFileMap.then.then.hasteMap (/Users/gsklee/Projects/GitHub/TodayDesign/studymelbourne-mobile/node_modules/metro/node_modules/jest-haste-map/build/index.js:279:21)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:4499) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:4499) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
error: bundling failed: Error: `fsevents` unavailable (this watcher can only be used on Darwin)
    at new FSEventsWatcher (/Users/gsklee/Projects/GitHub/TodayDesign/studymelbourne-mobile/node_modules/sane/src/fsevents_watcher.js:41:11)
    at createWatcher (/Users/gsklee/Projects/GitHub/TodayDesign/studymelbourne-mobile/node_modules/metro/node_modules/jest-haste-map/build/index.js:621:23)
    at Array.map (<anonymous>)
    at HasteMap._watch (/Users/gsklee/Projects/GitHub/TodayDesign/studymelbourne-mobile/node_modules/metro/node_modules/jest-haste-map/build/index.js:769:44)
    at _buildPromise._buildFileMap.then.then.hasteMap (/Users/gsklee/Projects/GitHub/TodayDesign/studymelbourne-mobile/node_modules/metro/node_modules/jest-haste-map/build/index.js:279:21)
    at process._tickCallback (internal/process/next_tick.js:68:7)
 BUNDLE  [ios, dev] ./index.js β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 0.0% (0/1), failed.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 7
  • Comments: 16 (4 by maintainers)

Commits related to this issue

Most upvoted comments

For future reference. You don’t have to delete the whole yarn.lock in such cases. Just remove the lines related to fsevents (simply put, search for blocks starting with fsevents@ and remove them). Then just re-run yarn - it will forget about mapping to an obsolete version of a package and use the right one.

@bnoordhuis I got things working after upgrading to Node 10.5.0 and deleting yarn.lock.

Okay, given that env V=1 npm install fsevents works, I’d say this is an issue with yarn, not fsevents.

@StanleySathler, I would just recommend doing it very carefully, as any wrong change in this file may result in unexpected behavior. Apart from that, I find this approach very useful. IMO much better than losing all dependency locks and ending up with (in many cases) a completely new set of dependencies.

I had installed yarn via Homebrew and was struggling through this issue for a long time after updating yarn.

Here is how I nuked everything and things got back normal

  1. Deleted all node-modules and .yarn from system cache, usr/lib, ~/.

Search all node-modules folder

$ find / -type d -name "*node-modules*"
  1. Restart the system
  2. Deleted yarn.lock from the module then yarn install. Without this step I was still getting the same error. Only after deleting the lock file thing resolve.

@gsklee Your suggestions of removing, in my case, package-lock.json helped resolved this issue, thank you!

Okay, noted. The output still looks kind of mangled though.

What does env V=1 npm install fsevents print? What about c++ -v?