bufferutil: node-gyp failed to rebuild Xcode 13

I’m having a weird issue when adding bufferutil(4.0) to an electron project that runs electron-rebuild(3.2.3) throws this error where it’s trying to move a lipo file to a nonexistent directory. Not sure if it’s directly related to Xcode 13 or something else. Here are my laptop specs and error message.

MacOS BigSur npm version: 7.24.1 Node version: 14.17.5 Python version: 3.9.0


Building modules: 0/2  CC(target) Release/obj.target/bufferutil/src/bufferutil.o
  CC(target) Release/obj.target/bufferutil/src/bufferutil.o
⠇ Building modules: 0/2  SOLINK_MODULE(target) Release/bufferutil.node
  SOLINK_MODULE(target) Release/bufferutil.node
⠴ Building modules: 0/2error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't move temporary file: Release/bufferutil.node to file: Release/bufferutil.node.lipo (No such file or directory)

⠦ Building modules: 0/2make: *** [Release/bufferutil.node] Error 1
✖ Rebuild Failed

An unhandled error occurred inside electron-rebuild
node-gyp failed to rebuild '/Users/macbookpro/Documents/my-company/project/project-desktop/build/app/node_modules/utf-8-validate'.
For more information, rerun with the DEBUG environment variable set to "electron-rebuild".

Error: make failed with exit code: 2



Error: node-gyp failed to rebuild '/Users/macbookpro/Documents/my-company/project/project-desktop/build/app/node_modules/utf-8-validate'.
For more information, rerun with the DEBUG environment variable set to "electron-rebuild".

Error: make failed with exit code: 2


    at NodeGyp.rebuildModule (/Users/macbookpro/Documents/my-company/project/project-desktop/node_modules/electron-rebuild/lib/src/module-type/node-gyp.js:109:19)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async ModuleRebuilder.rebuildNodeGypModule (/Users/macbookpro/Documents/my-company/project/project-desktop/node_modules/electron-rebuild/lib/src/module-rebuilder.js:94:9)
    at async Rebuilder.rebuildModuleAt (/Users/macbookpro/Documents/my-company/project/project-desktop/node_modules/electron-rebuild/lib/src/rebuild.js:226:9)
    at async Promise.all (index 123)
    at async Rebuilder.rebuild (/Users/macbookpro/Documents/my-company/project/project-desktop/node_modules/electron-rebuild/lib/src/rebuild.js:180:13)
    at async /Users/macbookpro/Documents/my-company/project/project-desktop/node_modules/electron-rebuild/lib/src/cli.js:154:9
child_process.js:836
    throw err;

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 22 (11 by maintainers)

Commits related to this issue

Most upvoted comments

i’ve got a similar error in github action with nodejs 14 and node-gyp 5 and bufferutil 4.0.4. Works with 4.0.3

> bufferutil@4.0.4 install /Users/runner/work/fdk-mobile/fdk-mobile/node_modules/bufferutil
> node-gyp-build

  CC(target) Release/obj.target/bufferutil/src/bufferutil.o
In file included from ../src/bufferutil.c:2:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/assert.h:42:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/cdefs.h:807:2: error: Unsupported architecture
#error Unsupported architecture
 ^
In file included from ../src/bufferutil.c:3:
In file included from /Users/runner/Library/Caches/node-gyp/14.17.6/include/node/node_api.h:12:
In file included from /Users/runner/Library/Caches/node-gyp/14.17.6/include/node/js_native_api.h:24:
In file included from /Users/runner/Library/Caches/node-gyp/14.17.6/include/node/js_native_api_types.h:8:
In file included from /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/stdint.h:52:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdint.h:52:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:33:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/machine/_types.h:34:2: error: architecture not supported
#error architecture not supported
 ^
In file included from ../src/bufferutil.c:3:
In file included from /Users/runner/Library/Caches/node-gyp/14.17.6/include/node/node_api.h:12:
In file included from /Users/runner/Library/Caches/node-gyp/14.17.6/include/node/js_native_api.h:24:
In file included from /Users/runner/Library/Caches/node-gyp/14.17.6/include/node/js_native_api_types.h:8:
In file included from /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/stdint.h:52:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdint.h:52:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:55:9: error: unknown type name '__int64_t'
typedef __int64_t       __darwin_blkcnt_t;      /* total blocks */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:56:9: error: unknown type name '__int32_t'
typedef __int32_t       __darwin_blksize_t;     /* preferred block size */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:57:9: error: unknown type name '__int32_t'
typedef __int32_t       __darwin_dev_t;         /* dev_t */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:60:9: error: unknown type name '__uint32_t'
typedef __uint32_t      __darwin_gid_t;         /* [???] process and group IDs */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:61:9: error: unknown type name '__uint32_t'
typedef __uint32_t      __darwin_id_t;          /* [XSI] pid_t, uid_t, or gid_t*/
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:62:9: error: unknown type name '__uint64_t'; did you mean 'uint64_t'?
typedef __uint64_t      __darwin_ino64_t;       /* [???] Used for 64 bit inodes */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_types/_uint64_t.h:31:28: note: 'uint64_t' declared here
typedef unsigned long long uint64_t;
                           ^
In file included from ../src/bufferutil.c:3:
In file included from /Users/runner/Library/Caches/node-gyp/14.17.6/include/node/node_api.h:12:
In file included from /Users/runner/Library/Caches/node-gyp/14.17.6/include/node/js_native_api.h:24:
In file included from /Users/runner/Library/Caches/node-gyp/14.17.6/include/node/js_native_api_types.h:8:
In file included from /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/stdint.h:52:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdint.h:52:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:68:9: error: unknown type name '__darwin_natural_t'
typedef __darwin_natural_t __darwin_mach_port_name_t; /* Used by mach */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:70:9: error: unknown type name '__uint16_t'
typedef __uint16_t      __darwin_mode_t;        /* [???] Some file attributes */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:71:9: error: unknown type name '__int64_t'
typedef __int64_t       __darwin_off_t;         /* [???] Used for file sizes */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:72:9: error: unknown type name '__int32_t'
typedef __int32_t       __darwin_pid_t;         /* [???] process and group IDs */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:73:9: error: unknown type name '__uint32_t'
typedef __uint32_t      __darwin_sigset_t;      /* [???] signal set */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:74:9: error: unknown type name '__int32_t'
typedef __int32_t       __darwin_suseconds_t;   /* [???] microseconds */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:75:9: error: unknown type name '__uint32_t'
typedef __uint32_t      __darwin_uid_t;         /* [???] user IDs */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:76:9: error: unknown type name '__uint32_t'
typedef __uint32_t      __darwin_useconds_t;    /* [???] microseconds */
        ^
In file included from ../src/bufferutil.c:3:
In file included from /Users/runner/Library/Caches/node-gyp/14.17.6/include/node/node_api.h:12:
In file included from /Users/runner/Library/Caches/node-gyp/14.17.6/include/node/js_native_api.h:24:
In file included from /Users/runner/Library/Caches/node-gyp/14.17.6/include/node/js_native_api_types.h:8:
In file included from /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/stdint.h:52:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdint.h:53:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types/_intptr_t.h:30:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/machine/types.h:37:2: error: architecture not supported
#error architecture not supported
 ^
In file included from ../src/bufferutil.c:3:
In file included from /Users/runner/Library/Caches/node-gyp/14.17.6/include/node/node_api.h:12:
In file included from /Users/runner/Library/Caches/node-gyp/14.17.6/include/node/js_native_api.h:24:
In file included from /Users/runner/Library/Caches/node-gyp/14.17.6/include/node/js_native_api_types.h:8:
In file included from /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/stdint.h:52:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdint.h:53:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types/_intptr_t.h:32:9: error: unknown type name '__darwin_intptr_t'
typedef __darwin_intptr_t       intptr_t;
        ^
18 errors generated.
make: *** [Release/obj.target/bufferutil/src/bufferutil.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/runner/hostedtoolcache/node/14.17.6/x64/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Darwin 19.6.0
gyp ERR! command "/Users/runner/hostedtoolcache/node/14.17.6/x64/bin/node" "/Users/runner/hostedtoolcache/node/14.17.6/x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/runner/work/fdk-mobile/fdk-mobile/node_modules/bufferutil
gyp ERR! node -v v14.17.6
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bufferutil@4.0.4 install: `node-gyp-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the bufferutil@4.0.4 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Yes, the binding.gyp changes in https://github.com/websockets/bufferutil/commit/bedfb2c75a947e8486f353c016e16118f0cc2a8f are breaking. I missed it sorry.

Anyway it shouldn’t be a big issue as a prebuilt binary is included in the package. Most people using this module won’t even notice.

Will try it tomorrow. Thanks

Luigi Pinca @.***> schrieb am Mo., 4. Okt. 2021, 20:53:

Yes.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/websockets/bufferutil/issues/136#issuecomment-933761177, or unsubscribe https://github.com/notifications/unsubscribe-auth/AARI4YG54FFC6O63FTWJM4LUFHZ2DANCNFSM5E65VBZQ .