jopemachine / alfred-chrome-workflow

Chromium based browser workflow for Alfred 4
https://www.npmjs.com/package/alfred-chrome-workflow
MIT License
39 stars 3 forks source link

better-sqlite3 related Install issue #2

Closed jopemachine closed 3 years ago

jopemachine commented 3 years ago

Issue

npm WARN deprecated xmldom@0.1.31: Deprecated due to CVE-2021-21366 resolved in 0.5.0

npm ERR! code 1

npm ERR! path /usr/local/lib/node_modules/alfred-chrome-workflow/node_modules/better-sqlite3

npm ERR! command failed

npm ERR! command sh -c prebuild-install || npm run build-release

npm ERR! > better-sqlite3@7.1.2 build-release

npm ERR! > node-gyp rebuild --release

npm ERR! gyp info it worked if it ends with ok

npm ERR! gyp info using node-gyp@7.1.2

npm ERR! gyp info using node@15.5.0 | darwin | x64

npm ERR! gyp info find Python using Python version 3.9.1 found at "/usr/local/opt/python@3.9/bin/python3.9"

npm ERR! gyp info spawn /usr/local/opt/python@3.9/bin/python3.9

npm ERR! gyp info spawn args [

npm ERR! gyp info spawn args '/usr/local/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 '/usr/local/lib/node_modules/alfred-chrome-workflow/node_modules/better-sqlite3/build/config.gypi',

npm ERR! gyp info spawn args '-I',

npm ERR! gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',

npm ERR! gyp info spawn args '-I',

npm ERR! gyp info spawn args '/Users/XXXXXX/Library/Caches/node-gyp/15.5.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/XXXXXX/Library/Caches/node-gyp/15.5.0',

npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',

npm ERR! gyp info spawn args '-Dnode_lib_file=/Users/XXXXXX/Library/Caches/node-gyp/15.5.0/<(target_arch)/node.lib',

npm ERR! gyp info spawn args '-Dmodule_root_dir=/usr/local/lib/node_modules/alfred-chrome-workflow/node_modules/better-sqlite3',

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! No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.

npm ERR!

npm ERR! No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.

npm ERR!

npm ERR! No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.

npm ERR!

npm ERR! gyp info spawn make

npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]

npm ERR! xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

npm ERR! gyp ERR! build error

npm ERR! gyp ERR! stack Error: make failed with exit code: 1

npm ERR! gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)

npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:376:20)

npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:284:12)

npm ERR! gyp ERR! System Darwin 20.3.0

npm ERR! gyp ERR! command "/usr/local/Cellar/node/15.5.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"

npm ERR! gyp ERR! cwd /usr/local/lib/node_modules/alfred-chrome-workflow/node_modules/better-sqlite3

npm ERR! gyp ERR! node -v v15.5.0

npm ERR! gyp ERR! node-gyp -v v7.1.2

npm ERR! gyp ERR! not ok

npm ERR! npm ERR! code 1

npm ERR! npm ERR! path /usr/local/lib/node_modules/alfred-chrome-workflow/node_modules/better-sqlite3

npm ERR! npm ERR! command failed

npm ERR! npm ERR! command sh -c node-gyp rebuild --release
jopemachine commented 3 years ago

It seems to be error caused by missing some dev tools.

By executing below commands, it can be resolved.

xcode-select --install
jopemachine commented 3 years ago

It seems to be related to the issue below.

https://github.com/nodejs/node-gyp/issues/1694

Possible solution

  1. xcode-select --install
  2. Downgrade node version to 10.18.0