question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Electron rebuild fails with fsevents

See original GitHub issue

OS: Mac(10.14.1) Node: 10.13.0 yarn: 1.12.3 npm: 6.4.1

After running yarn electron-rebuild, I get this error:

yarn run v1.12.3
$ yarn electron-rebuild && yarn build-css
$ /Users/canliu/dev/newtonsit/linkvue/node_modules/.bin/electron-rebuild
✖ Rebuild Failed

An unhandled error occurred inside electron-rebuild
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@10.13.0 | darwin | x64
gyp info spawn /usr/bin/python
gyp info spawn args [ '/Users/canliu/dev/newtonsit/linkvue/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/canliu/dev/newtonsit/linkvue/node_modules/fsevents/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/canliu/dev/newtonsit/linkvue/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/canliu/.electron-gyp/.node-gyp/iojs-2.0.14/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/canliu/.electron-gyp/.node-gyp/iojs-2.0.14',
gyp info spawn args   '-Dnode_gyp_dir=/Users/canliu/dev/newtonsit/linkvue/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/canliu/.electron-gyp/.node-gyp/iojs-2.0.14/<(target_arch)/iojs.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/canliu/dev/newtonsit/linkvue/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 make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  SOLINK_MODULE(target) Release/.node
  CXX(target) Release/obj.target/fse/fsevents.o
In file included from ../fsevents.cc:10:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:43:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:72:
/usr/local/include/Block.h:16:3: error: Never include this file directly. Use <lzma.h> instead.
#       error Never include this file directly. Use <lzma.h> instead.
        ^
/usr/local/include/Block.h:93:2: error: unknown type name 'lzma_check'
        lzma_check check;
        ^
/usr/local/include/Block.h:148:2: error: unknown type name 'lzma_vli'
        lzma_vli compressed_size;
        ^
/usr/local/include/Block.h:172:2: error: unknown type name 'lzma_vli'
        lzma_vli uncompressed_size;
        ^
/usr/local/include/Block.h:200:2: error: unknown type name 'lzma_filter'
        lzma_filter *filters;
        ^
/usr/local/include/Block.h:217:20: error: use of undeclared identifier 'LZMA_CHECK_SIZE_MAX'
        uint8_t raw_check[LZMA_CHECK_SIZE_MAX];
                          ^
/usr/local/include/Block.h:231:2: error: unknown type name 'lzma_vli'
        lzma_vli reserved_int3;
        ^
/usr/local/include/Block.h:232:2: error: unknown type name 'lzma_vli'
        lzma_vli reserved_int4;
        ^
/usr/local/include/Block.h:233:2: error: unknown type name 'lzma_vli'
        lzma_vli reserved_int5;
        ^
/usr/local/include/Block.h:234:2: error: unknown type name 'lzma_vli'
        lzma_vli reserved_int6;
        ^
/usr/local/include/Block.h:235:2: error: unknown type name 'lzma_vli'
        lzma_vli reserved_int7;
        ^
/usr/local/include/Block.h:236:2: error: unknown type name 'lzma_vli'
        lzma_vli reserved_int8;
        ^
/usr/local/include/Block.h:237:2: error: unknown type name 'lzma_reserved_enum'
        lzma_reserved_enum reserved_enum1;
        ^
/usr/local/include/Block.h:238:2: error: unknown type name 'lzma_reserved_enum'
        lzma_reserved_enum reserved_enum2;
        ^
/usr/local/include/Block.h:239:2: error: unknown type name 'lzma_reserved_enum'
        lzma_reserved_enum reserved_enum3;
        ^
/usr/local/include/Block.h:240:2: error: unknown type name 'lzma_reserved_enum'
        lzma_reserved_enum reserved_enum4;
        ^
/usr/local/include/Block.h:261:2: error: unknown type name 'lzma_bool'
        lzma_bool ignore_check;
        ^
/usr/local/include/Block.h:263:2: error: unknown type name 'lzma_bool'
        lzma_bool reserved_bool2;
        ^
/usr/local/include/Block.h:264:2: error: unknown type name 'lzma_bool'
        lzma_bool reserved_bool3;
        ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
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/canliu/dev/newtonsit/linkvue/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:240:12)
gyp ERR! System Darwin 18.2.0
gyp ERR! command "/Users/canliu/.nvm/versions/node/v10.13.0/bin/node" "/Users/canliu/dev/newtonsit/linkvue/node_modules/electron-rebuild/node_modules/.bin/node-gyp" "rebuild" "--target=2.0.14" "--arch=x64" "--dist-url=https://atom.io/download/electron" "--build-from-source" "--module_name=fse" "--module_path=/Users/canliu/dev/newtonsit/linkvue/node_modules/fsevents/lib/binding/Release/electron-v2.0-darwin-x64" "--remote_path=./v1.2.4/" "--package_name=fse-v1.2.4-electron-v2.0-darwin-x64.tar.gz" "--host=https://fsevents-binaries.s3-us-west-2.amazonaws.com"
gyp ERR! cwd /Users/canliu/dev/newtonsit/linkvue/node_modules/fsevents
gyp ERR! node -v v10.13.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

Failed with exit code: 1

Error: gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@10.13.0 | darwin | x64
gyp info spawn /usr/bin/python
gyp info spawn args [ '/Users/canliu/dev/newtonsit/linkvue/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/canliu/dev/newtonsit/linkvue/node_modules/fsevents/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/canliu/dev/newtonsit/linkvue/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/canliu/.electron-gyp/.node-gyp/iojs-2.0.14/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/canliu/.electron-gyp/.node-gyp/iojs-2.0.14',
gyp info spawn args   '-Dnode_gyp_dir=/Users/canliu/dev/newtonsit/linkvue/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/canliu/.electron-gyp/.node-gyp/iojs-2.0.14/<(target_arch)/iojs.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/canliu/dev/newtonsit/linkvue/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 make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  SOLINK_MODULE(target) Release/.node
  CXX(target) Release/obj.target/fse/fsevents.o
In file included from ../fsevents.cc:10:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:43:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:72:
/usr/local/include/Block.h:16:3: error: Never include this file directly. Use <lzma.h> instead.
#       error Never include this file directly. Use <lzma.h> instead.
        ^
/usr/local/include/Block.h:93:2: error: unknown type name 'lzma_check'
        lzma_check check;
        ^
/usr/local/include/Block.h:148:2: error: unknown type name 'lzma_vli'
        lzma_vli compressed_size;
        ^
/usr/local/include/Block.h:172:2: error: unknown type name 'lzma_vli'
        lzma_vli uncompressed_size;
        ^
/usr/local/include/Block.h:200:2: error: unknown type name 'lzma_filter'
        lzma_filter *filters;
        ^
/usr/local/include/Block.h:217:20: error: use of undeclared identifier 'LZMA_CHECK_SIZE_MAX'
        uint8_t raw_check[LZMA_CHECK_SIZE_MAX];
                          ^
/usr/local/include/Block.h:231:2: error: unknown type name 'lzma_vli'
        lzma_vli reserved_int3;
        ^
/usr/local/include/Block.h:232:2: error: unknown type name 'lzma_vli'
        lzma_vli reserved_int4;
        ^
/usr/local/include/Block.h:233:2: error: unknown type name 'lzma_vli'
        lzma_vli reserved_int5;
        ^
/usr/local/include/Block.h:234:2: error: unknown type name 'lzma_vli'
        lzma_vli reserved_int6;
        ^
/usr/local/include/Block.h:235:2: error: unknown type name 'lzma_vli'
        lzma_vli reserved_int7;
        ^
/usr/local/include/Block.h:236:2: error: unknown type name 'lzma_vli'
        lzma_vli reserved_int8;
        ^
/usr/local/include/Block.h:237:2: error: unknown type name 'lzma_reserved_enum'
        lzma_reserved_enum reserved_enum1;
        ^
/usr/local/include/Block.h:238:2: error: unknown type name 'lzma_reserved_enum'
        lzma_reserved_enum reserved_enum2;
        ^
/usr/local/include/Block.h:239:2: error: unknown type name 'lzma_reserved_enum'
        lzma_reserved_enum reserved_enum3;
        ^
/usr/local/include/Block.h:240:2: error: unknown type name 'lzma_reserved_enum'
        lzma_reserved_enum reserved_enum4;
        ^
/usr/local/include/Block.h:261:2: error: unknown type name 'lzma_bool'
        lzma_bool ignore_check;
        ^
/usr/local/include/Block.h:263:2: error: unknown type name 'lzma_bool'
        lzma_bool reserved_bool2;
        ^
/usr/local/include/Block.h:264:2: error: unknown type name 'lzma_bool'
        lzma_bool reserved_bool3;
        ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
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/canliu/dev/newtonsit/linkvue/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:240:12)
gyp ERR! System Darwin 18.2.0
gyp ERR! command "/Users/canliu/.nvm/versions/node/v10.13.0/bin/node" "/Users/canliu/dev/newtonsit/linkvue/node_modules/electron-rebuild/node_modules/.bin/node-gyp" "rebuild" "--target=2.0.14" "--arch=x64" "--dist-url=https://atom.io/download/electron" "--build-from-source" "--module_name=fse" "--module_path=/Users/canliu/dev/newtonsit/linkvue/node_modules/fsevents/lib/binding/Release/electron-v2.0-darwin-x64" "--remote_path=./v1.2.4/" "--package_name=fse-v1.2.4-electron-v2.0-darwin-x64.tar.gz" "--host=https://fsevents-binaries.s3-us-west-2.amazonaws.com"
gyp ERR! cwd /Users/canliu/dev/newtonsit/linkvue/node_modules/fsevents
gyp ERR! node -v v10.13.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

Failed with exit code: 1
    at SafeSubscriber._error (/Users/canliu/dev/newtonsit/linkvue/node_modules/spawn-rx/lib/src/index.js:277:84)
    at SafeSubscriber.__tryOrUnsub (/Users/canliu/dev/newtonsit/linkvue/node_modules/spawn-rx/node_modules/rxjs/Subscriber.js:242:16)
    at SafeSubscriber.error (/Users/canliu/dev/newtonsit/linkvue/node_modules/spawn-rx/node_modules/rxjs/Subscriber.js:201:26)
    at Subscriber._error (/Users/canliu/dev/newtonsit/linkvue/node_modules/spawn-rx/node_modules/rxjs/Subscriber.js:132:26)
    at Subscriber.error (/Users/canliu/dev/newtonsit/linkvue/node_modules/spawn-rx/node_modules/rxjs/Subscriber.js:106:18)
    at MapSubscriber.Subscriber._error (/Users/canliu/dev/newtonsit/linkvue/node_modules/spawn-rx/node_modules/rxjs/Subscriber.js:132:26)
    at MapSubscriber.Subscriber.error (/Users/canliu/dev/newtonsit/linkvue/node_modules/spawn-rx/node_modules/rxjs/Subscriber.js:106:18)
    at SafeSubscriber._next (/Users/canliu/dev/newtonsit/linkvue/node_modules/spawn-rx/lib/src/index.js:251:65)
    at SafeSubscriber.__tryOrUnsub (/Users/canliu/dev/newtonsit/linkvue/node_modules/spawn-rx/node_modules/rxjs/Subscriber.js:242:16)
    at SafeSubscriber.next (/Users/canliu/dev/newtonsit/linkvue/node_modules/spawn-rx/node_modules/rxjs/Subscriber.js:189:22)
error Command failed with exit code 255.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I’m not sure if it’s an issue with fsevents.o. I’ve tried changing node version to 8.11, 8.12, 8.13, 10.5, 10.12 with nvm, but none of them works.

Can someone please help me? I’ve been stuck here for 3 days. T_T.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

3reactions
nerdmaxcommented, Nov 26, 2018

I have resolved this issue.

It’s an issue with compiling C++ files.

After installing Mac’s updates. something added some files to my /usr/local/include folder. If you run cpp -v, you can see cpp is including some headers in that directory and it’s not compatible with those new files.

For my case, I fix that by removing /usr/local/include/block.h file.

If you are having the same issue. Try deleting or moving /usr/local/include to another place. (PS: Backup this folder first, just in case this fix breaks something else.)

Reference: https://stackoverflow.com/questions/46872922/broken-c-std-libraries-on-macos-high-sierra-10-13/47401866

0reactions
bennettwbrowncommented, Dec 23, 2018

I have resolved this issue.

It’s an issue with compiling C++ files.

After installing Mac’s updates. something added some files to my /usr/local/include folder. If you run cpp -v, you can see cpp is including some headers in that directory and it’s not compatible with those new files.

For my case, I fix that by removing /usr/local/include/block.h file.

If you are having the same issue. Try deleting or moving /usr/local/include to another place. (PS: Backup this folder first, just in case this fix breaks something else.)

Reference: https://stackoverflow.com/questions/46872922/broken-c-std-libraries-on-macos-high-sierra-10-13/47401866

Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Electron rebuild fails with fsevents · Issue #264 - GitHub
After running yarn electron-rebuild , I get this error: yarn run v1.12.3 $ yarn electron-rebuild && yarn build-css $ /Users/canliu/dev/newtonsit ...
Read more >
Electron cannot build platform dependencies fsevents and/or ...
To successfully run the app locally I had to rebuild them using ./node_modules/.bin/electron-rebuild -p -t "dev,prod,optional" And now when I ...
Read more >
Electron Client Build Failed in Windows - Support - Joplin Forum
To run electron-rebuild.cmd we need to pass one command line arguments i.e module directory which is the path to package.json we have to...
Read more >
Fix broken 'node-gyp' issue for Mac OS | by Fernando De Freitas
This issue is usually caused because a node-gyp config file called common.gypi is not set up for your current Mac OS version. Just...
Read more >
Debugging "Make Failed with Exit Code 2" Error - CodeForGeek
Debug #4: Update Node and NPM ... The old version of Node and NPM can also cause this issue. Re-install it with build...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found