Skip to content

Does not work on Apple M1, nodejs v20 #48

@yfwucn

Description

@yfwucn

Apple M1, Sonoma 14.4.1
nvm installed nodejs v20.11.1

npm install gives:

npm ERR! code 1
npm ERR! path <project_folder>/node_modules/ffi-napi/node_modules/ref-napi
npm ERR! command failed
npm ERR! command sh -c node-gyp-build
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | darwin | arm64
npm ERR! gyp info find Python using Python version 3.12.2 found at "/opt/homebrew/opt/[email protected]/bin/python3.12"
npm ERR! gyp info spawn /opt/homebrew/opt/[email protected]/bin/python3.12
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '<node_folder>/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'make',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '<project_folder>//node_modules/ffi-napi/node_modules/ref-napi/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '<node_folder>/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Library/Caches/node-gyp/20.11.1/include/node/common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=
/Library/Caches/node-gyp/20.11.1',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=<node_folder>/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=~/Library/Caches/node-gyp/20.11.1/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=<project_folder>/node_modules/ffi-napi/node_modules/ref-napi',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! make: *** No rule to make target Release/obj.target/nothing/../node-addon-api/src/nothing.o', needed by Release/nothing.a'. Stop.
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: make failed with exit code: 2
npm ERR! gyp ERR! stack at ChildProcess. (<node_folder>/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:209:23)
npm ERR! gyp ERR! System Darwin 23.4.0
npm ERR! gyp ERR! command "<node_folder>/bin/node" "<node_folder>/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd <project_folder>/node_modules/ffi-napi/node_modules/ref-napi
npm ERR! gyp ERR! node -v v20.11.1
npm ERR! gyp ERR! node-gyp -v v10.0.1
npm ERR! gyp ERR! not ok

npm install --verbose shows there is something wrong with the prebuilds of ffi-napi:

npm ERR! <project_folder>/node_modules/node-gyp-build/node-gyp-build.js:60
npm ERR! throw new Error('No native build was found for ' + target + '\n loaded from: ' + dir + '\n')
npm ERR! ^
npm ERR!
npm ERR! Error: No native build was found for platform=darwin arch=arm64 runtime=node abi=115 uv=1 armv=8 libc=glibc node=20.11.1
npm ERR! loaded from: <project_folder>/node_modules/ffi-napi/node_modules/ref-napi
npm ERR!
npm ERR! at load.resolve.load.path (<project_folder>/node_modules/node-gyp-build/node-gyp-build.js:60:9)

npm_config_build_from_source=true npm install --verbose gives more error:
npm ERR! make: *** No rule to make target Release/obj.target/nothing/../node-addon-api/src/nothing.o', needed by Release/nothing.a'. Stop.
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: make failed with exit code: 2
npm ERR! gyp ERR! stack at ChildProcess. (<node_folder>/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:209:23)
npm ERR! gyp ERR! System Darwin 23.4.0
npm ERR! gyp ERR! command ".../bin/node" "<node_folder>lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd <project_folder>/node_modules/ffi-napi/node_modules/ref-napi
npm ERR! gyp ERR! node -v v20.11.1
npm ERR! gyp ERR! node-gyp -v v10.0.1
npm ERR! gyp ERR! not ok

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions