Bagbak unable to install through npm install -g bagbak
gelosecurity opened this issue · comments
Heyo, it's me again. Trying to install bagbak on my MacOS host. Thanks for all your help.
Node v20.1.0.
Describe the bug
npm error. Bagbak fails to install. I think it may be due to the frida dependency because I removed it from the package and it "built" successfully. (Although the tool ends up being broken/not able to run due to it not having frida)
To Reproduce
npm install
in git directory or npm install -g bagbak
Expected behavior
A clear and concise description of what you expected to happen.
Should install
Logs
npm install -g bagbak
npm ERR! code 1
npm ERR! path /opt/homebrew/lib/node_modules/bagbak/node_modules/frida
npm ERR! command failed
npm ERR! command sh -c prebuild-install || node-gyp rebuild
npm ERR! prebuild-install warn install No prebuilt binaries found (target=20.1.0 runtime=node arch=arm64 libc= platform=darwin)
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.3.1
npm ERR! gyp info using node@20.1.0 | darwin | arm64
npm ERR! gyp info find Python using Python version 3.9.6 found at "/Applications/Xcode.app/Contents/Developer/usr/bin/python3"
npm ERR! gyp info spawn /Applications/Xcode.app/Contents/Developer/usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/opt/homebrew/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 '/opt/homebrew/lib/node_modules/bagbak/node_modules/frida/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/gelosec/Library/Caches/node-gyp/20.1.0/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=/Users/gelosec/Library/Caches/node-gyp/20.1.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/Users/gelosec/Library/Caches/node-gyp/20.1.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/opt/homebrew/lib/node_modules/bagbak/node_modules/frida',
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: binding.gyp not found (cwd: /opt/homebrew/lib/node_modules/bagbak/node_modules/frida) while trying to load binding.gyp
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack at ChildProcess.onCpExit (/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:325:16)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:511:28)
npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:293:12)
npm ERR! gyp ERR! System Darwin 21.6.0
npm ERR! gyp ERR! command "/opt/homebrew/Cellar/node/20.1.0/bin/node" "/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /opt/homebrew/lib/node_modules/bagbak/node_modules/frida
npm ERR! gyp ERR! node -v v20.1.0
npm ERR! gyp ERR! node-gyp -v v9.3.1
npm ERR! gyp ERR! not ok
npm ERR! A complete log of this run can be found in: /Users/gelosec/.npm/_logs/2023-05-13T11_57_34_967Z-debug-0.log
Desktop (please complete the following information):
- OS: MacOS
- nodejs: 20.1.0
- frida-node: 16.0.19 (installed through pip3)
brew remove node
brew install node@19
npm install -g bagbak
BTW, use nvm when brew removed certain version of nodejs
brew install nvm
- Follow its instruction after installation command to add nvm to your
.zprofile
nvm install v19
nvm use v19
npm install -g bagbak