tree-sitter / node-tree-sitter

Node.js bindings for tree-sitter
https://www.npmjs.com/package/tree-sitter
MIT License
659 stars 115 forks source link

make: *** No rule to make target `Release/obj.target/tree_sitter/vendor/tree-sitter/lib/src/lib.o', needed by `Release/tree_sitter.a'. Stop. #212

Closed liaodalin19903 closed 3 months ago

liaodalin19903 commented 4 months ago

I cloned the node-tree-sitte on my macOS Sonoma 14.4:

when I execute the % sudo pnpm i:

I get error:

% sudo pnpm i 
Lockfile is up to date, resolution step is skipped
Packages: +427
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 427, reused 427, downloaded 0, added 427, done

dependencies:
+ node-addon-api 8.1.0
+ node-gyp-build 4.8.1

devDependencies:
+ @types/node 20.14.11
+ chai 4.4.1
+ jest 29.7.0
+ mocha 8.4.0
+ node-gyp 10.2.0
+ prebuildify 6.0.1
+ tmp 0.2.3
+ tree-sitter-c 0.21.4
+ tree-sitter-embedded-template 0.21.0
+ tree-sitter-html 0.20.3
+ tree-sitter-java 0.21.0
+ tree-sitter-javascript 0.21.4
+ tree-sitter-json 0.21.0
+ tree-sitter-python 0.21.0
+ tree-sitter-ruby 0.21.0
+ tree-sitter-rust 0.21.0

> tree-sitter@0.21.1 install /Users/markleo/github_repos/node-tree-sitter
> node-gyp-build

gyp info it worked if it ends with ok
gyp info using node-gyp@10.2.0
gyp info using node@18.20.3 | darwin | arm64
gyp info find Python using Python version 3.9.6 found at "/Library/Developer/CommandLineTools/usr/bin/python3"

gyp info spawn /Library/Developer/CommandLineTools/usr/bin/python3
gyp info spawn args [
gyp info spawn args '/Users/markleo/github_repos/node-tree-sitter/node_modules/.pnpm/node-gyp@10.2.0/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/Users/markleo/github_repos/node-tree-sitter/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/markleo/github_repos/node-tree-sitter/node_modules/.pnpm/node-gyp@10.2.0/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/markleo/Library/Caches/node-gyp/18.20.3/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/Users/markleo/Library/Caches/node-gyp/18.20.3',
gyp info spawn args '-Dnode_gyp_dir=/Users/markleo/github_repos/node-tree-sitter/node_modules/.pnpm/node-gyp@10.2.0/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/Users/markleo/Library/Caches/node-gyp/18.20.3/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/Users/markleo/github_repos/node-tree-sitter',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  TOUCH Release/obj.target/node_modules/.pnpm/node-addon-api@8.1.0/node_modules/node-addon-api/node_addon_api_except.stamp
make: *** No rule to make target `Release/obj.target/tree_sitter/vendor/tree-sitter/lib/src/lib.o', needed by `Release/tree_sitter.a'.  Stop.
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.<anonymous> (/Users/markleo/github_repos/node-tree-sitter/node_modules/.pnpm/node-gyp@10.2.0/node_modules/node-gyp/lib/build.js:216:23)
gyp ERR! System Darwin 23.4.0
gyp ERR! command "/usr/local/bin/node" "/Users/markleo/github_repos/node-tree-sitter/node_modules/.pnpm/node-gyp@10.2.0/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/markleo/github_repos/node-tree-sitter
gyp ERR! node -v v18.20.3
gyp ERR! node-gyp -v v10.2.0
gyp ERR! not ok 

 ELIFECYCLE  Command failed with exit code 1.
verhovsky commented 4 months ago

i'm surprised you got a different error message than #123

segevfiner commented 3 months ago

Did you do git submodule update --init?

liaodalin19903 commented 3 months ago

Did you do git submodule update --init?

Thanks, this works.