Skip to content

NPM Install Failing related to libtool static on ARM Darwin architecture platforms #20

@oycyc

Description

@oycyc

Bug report

Describe the bug

I'm running npm install -g snapshot/snaplet on my ARM macOS device and it is failing with the errors below. I'm using Node 20 LTS Iron, the latest LTS 22 gives the same issue.

Errors first point out
npm error prebuild-install warn install No prebuilt binaries found (target=20.19.0 runtime=node arch=arm64 libc= platform=darwin)

and that the libtool failed with npm error libtool: error: unrecognised option: '-static' See more below.

yangci@Yangcis-MacBook-Pro ~ % npm install -g @snaplet/snapshot
npm warn deprecated postgresql-client@2.5.5: Package name 'postgresql-client' has been changed to 'postgrejs'. Please consider to update dependencies in your package.json
npm warn deprecated @faker-js/faker@8.0.2: Please update to a newer version
npm error code 1
npm error path /opt/homebrew/lib/node_modules/@snaplet/snapshot/node_modules/better-sqlite3
npm error command failed
npm error command sh -c prebuild-install || node-gyp rebuild --release
npm error TOUCH ba23eeee118cd63e16015df367567cb043fed872.intermediate
npm error   ACTION deps_sqlite3_gyp_locate_sqlite3_target_copy_builtin_sqlite3 ba23eeee118cd63e16015df367567cb043fed872.intermediate
npm error   TOUCH Release/obj.target/deps/locate_sqlite3.stamp
npm error   CC(target) Release/obj.target/sqlite3/gen/sqlite3/sqlite3.o
npm error   LIBTOOL-STATIC Release/sqlite3.a
npm error Usage: /opt/homebrew/opt/libtool/libexec/gnubin/libtool [OPTION]... [MODE-ARG]...
npm error Try 'libtool --help' for more information.
npm error rm ba23eeee118cd63e16015df367567cb043fed872.intermediate
npm error prebuild-install warn install No prebuilt binaries found (target=20.19.0 runtime=node arch=arm64 libc= platform=darwin)
npm error gyp info it worked if it ends with ok
npm error gyp info using node-gyp@10.1.0
npm error gyp info using node@20.19.0 | darwin | arm64
npm error gyp info find Python using Python version 3.12.3 found at "/Library/Frameworks/Python.framework/Versions/3.12/bin/python3"
npm error gyp info spawn /Library/Frameworks/Python.framework/Versions/3.12/bin/python3
npm error gyp info spawn args [
npm error gyp info spawn args '/opt/homebrew/Cellar/node@20/20.19.0_1/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm error gyp info spawn args 'binding.gyp',
npm error gyp info spawn args '-f',
npm error gyp info spawn args 'make',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/opt/homebrew/lib/node_modules/@snaplet/snapshot/node_modules/better-sqlite3/build/config.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/opt/homebrew/Cellar/node@20/20.19.0_1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/Users/yangci/Library/Caches/node-gyp/20.19.0/include/node/common.gypi',
npm error gyp info spawn args '-Dlibrary=shared_library',
npm error gyp info spawn args '-Dvisibility=default',
npm error gyp info spawn args '-Dnode_root_dir=/Users/yangci/Library/Caches/node-gyp/20.19.0',
npm error gyp info spawn args '-Dnode_gyp_dir=/opt/homebrew/Cellar/node@20/20.19.0_1/lib/node_modules/npm/node_modules/node-gyp',
npm error gyp info spawn args '-Dnode_lib_file=/Users/yangci/Library/Caches/node-gyp/20.19.0/<(target_arch)/node.lib',
npm error gyp info spawn args '-Dmodule_root_dir=/opt/homebrew/lib/node_modules/@snaplet/snapshot/node_modules/better-sqlite3',
npm error gyp info spawn args '-Dnode_engine=v8',
npm error gyp info spawn args '--depth=.',
npm error gyp info spawn args '--no-parallel',
npm error gyp info spawn args '--generator-output',
npm error gyp info spawn args 'build',
npm error gyp info spawn args '-Goutput_dir=.'
npm error gyp info spawn args ]
npm error gyp info spawn make
npm error gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm error libtool:   error: unrecognised option: '-static'
npm error make: *** [Release/sqlite3.a] Error 1
npm error gyp ERR! build error 
npm error gyp ERR! stack Error: `make` failed with exit code: 2
npm error gyp ERR! stack at ChildProcess.<anonymous> (/opt/homebrew/Cellar/node@20/20.19.0_1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:209:23)
npm error gyp ERR! System Darwin 23.5.0
npm error gyp ERR! command "/opt/homebrew/Cellar/node@20/20.19.0_1/bin/node" "/opt/homebrew/Cellar/node@20/20.19.0_1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
npm error gyp ERR! cwd /opt/homebrew/lib/node_modules/@snaplet/snapshot/node_modules/better-sqlite3
npm error gyp ERR! node -v v20.19.0
npm error gyp ERR! node-gyp -v v10.1.0
npm error gyp ERR! not ok
npm error A complete log of this run can be found in: /Users/yangci/.npm/_logs/2025-04-21T20_31_18_237Z-debug-0.log
npm install -g @snaplet/snapshot
Time: 14.81s user | 7.82s system | 92% cpu | 24.386 total | 467216 KiB max RSS

Expected behavior

Being able to install Snaplet Snapshot on the latest LTS (or the previous Iron LTS) on ARM macOS

Screenshots

Image

System information

  • OS: macOs
  • Version of Node.js: 20 (per previous bug reports showing that LTS Iron is the only one that works without additional changes)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions