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

macOS install offckb error #204

Closed
u2 opened this issue Dec 18, 2024 · 3 comments
Closed

macOS install offckb error #204

u2 opened this issue Dec 18, 2024 · 3 comments

Comments

@u2
Copy link

u2 commented Dec 18, 2024

$ nvm use 22.12.0
Now using node v22.12.0 (npm v10.9.0)

# u2 at u2deMacBook-Pro in ~ [17:41:33]
$ npm install -g @offckb/cli
npm error code 1
npm error path /Users/u2/.nvm/versions/node/v22.12.0/lib/node_modules/@offckb/cli/node_modules/cpu-features
npm error command failed
npm error command sh -c node buildcheck.js > buildcheck.gypi && node-gyp rebuild
npm error CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_aarch64_linux_or_android.o
npm error   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_aarch64_macos_or_iphone.o
npm error   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_aarch64_windows.o
npm error   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_arm_linux_or_android.o
npm error   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_mips_linux_or_android.o
npm error   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_ppc_linux.o
npm error   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_freebsd.o
npm error   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_linux_or_android.o
npm error   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_macos.o
npm error   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_windows.o
npm error   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/filesystem.o
npm error   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/stack_line_reader.o
npm error   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/string_view.o
npm error   LIBTOOL-STATIC Release/cpu_features.a
npm error Usage: /usr/local/bin/libtool [OPTION]... [MODE-ARG]...
npm error Try 'libtool --help' for more information.
npm error gyp info it worked if it ends with ok
npm error gyp info using node-gyp@10.2.0
npm error gyp info using node@22.12.0 | darwin | x64
npm error gyp info find Python using Python version 3.10.8 found at "/usr/local/opt/python@3.10/bin/python3.10"
npm error gyp info spawn /usr/local/opt/python@3.10/bin/python3.10
npm error gyp info spawn args [
npm error gyp info spawn args '/Users/u2/.nvm/versions/node/v22.12.0/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 '/Users/u2/.nvm/versions/node/v22.12.0/lib/node_modules/@offckb/cli/node_modules/cpu-features/build/config.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/Users/u2/.nvm/versions/node/v22.12.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/Users/u2/Library/Caches/node-gyp/22.12.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/u2/Library/Caches/node-gyp/22.12.0',
npm error gyp info spawn args '-Dnode_gyp_dir=/Users/u2/.nvm/versions/node/v22.12.0/lib/node_modules/npm/node_modules/node-gyp',
npm error gyp info spawn args '-Dnode_lib_file=/Users/u2/Library/Caches/node-gyp/22.12.0/<(target_arch)/node.lib',
npm error gyp info spawn args '-Dmodule_root_dir=/Users/u2/.nvm/versions/node/v22.12.0/lib/node_modules/@offckb/cli/node_modules/cpu-features',
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/cpu_features.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> (/Users/u2/.nvm/versions/node/v22.12.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:216:23)
npm error gyp ERR! System Darwin 21.6.0
npm error gyp ERR! command "/Users/u2/.nvm/versions/node/v22.12.0/bin/node" "/Users/u2/.nvm/versions/node/v22.12.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm error gyp ERR! cwd /Users/u2/.nvm/versions/node/v22.12.0/lib/node_modules/@offckb/cli/node_modules/cpu-features
npm error gyp ERR! node -v v22.12.0
npm error gyp ERR! node-gyp -v v10.2.0
npm error gyp ERR! not ok
npm error A complete log of this run can be found in: /Users/u2/.npm/_logs/2024-12-18T09_42_03_995Z-debug-0.log
@RetricSu
Copy link
Collaborator

seems node-gyp building the cpu-features lib failed, can you try install xcode to see if it works:

xcode-select --install

and btw maybe check the libtool version:

~  brew info libtool
==> libtool: stable 2.5.3 (bottled)

@u2
Copy link
Author

u2 commented Dec 24, 2024

$ which libtool       
/usr/local/bin/libtool

# u2 at u2deMacBook-Pro.local in ~/my-cargo [17:20:55]
$ libtool --version
libtool (GNU libtool) 2.4.6
Written by Gordon Matzigkeit, 1996

Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@u2
Copy link
Author

u2 commented Dec 24, 2024

This works ok for me!
nodejs/node#2341 (comment)

$ brew unlink libtool
Unlinking /usr/local/Cellar/libtool/2.5.4... 20 symlinks removed.

# u2 at u2deMacBook-Pro.local in ~/my-cargo [17:21:58]
$ rm -rf /usr/local/bin/libtool

# u2 at u2deMacBook-Pro.local in ~/my-cargo [17:22:03]
$ which libtool
/usr/bin/libtool

$ npm install -g @offckb/cli   

added 172 packages in 28s

20 packages are looking for funding
  run `npm fund` for details

Thank you anyway.

@u2 u2 closed this as completed Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants