npm install of the published package fails outright on linux-arm64. The engine half is fine; the install never reaches it.
Symptom
On a clean arm64 machine with node and nothing else:
npm error path .../node_modules/tree-sitter
npm error gyp ERR! stack Error: not found: make
Installing a full build toolchain does not fix it. The failure moves to a nested copy and becomes:
npm error path .../node_modules/tree-sitter-groovy/node_modules/tree-sitter-java
make: *** No rule to make target 'Release/obj.target/../../../node-addon-api/node_addon_api_except.stamp'
Two causes
No arm64 prebuilds in the 0.21.x generation. Every native dependency falls back to node-gyp, which needs a compiler the user does not have.
| package |
linux-arm64 prebuild |
| tree-sitter@0.21.1 |
no |
| tree-sitter@0.22.4 |
yes |
| tree-sitter-java@0.21.0 |
no |
| tree-sitter-java@0.23.4 |
yes |
| tree-sitter-python@0.21.0 |
no |
| tree-sitter-python@0.23.2 |
no |
| tree-sitter-python@0.23.6 |
yes |
| tree-sitter-c-sharp@0.23.1 |
yes |
| tree-sitter-groovy@0.1.2 |
yes |
A nested duplicate that cannot build. tree-sitter-groovy pins tree-sitter-java@0.23.4 exactly while the parser asks for ^0.21.0. The two ranges cannot both be satisfied, so npm nests a second copy, and the nested copy's gyp config resolves node-addon-api by a relative path whose ../ count is wrong once nested. This is why a toolchain does not help. A caret range is not enough to dedupe either: ^0.23.4 resolves to 0.23.5 and nests again. The pin has to match exactly.
Proposed fix
| dep |
from |
to |
| tree-sitter |
^0.21.1 |
^0.22.4 |
| tree-sitter-java |
^0.21.0 |
0.23.4 exact |
| tree-sitter-python |
^0.21.0 |
^0.23.6 |
tree-sitter-java@0.23.4 declares peerDependencies { tree-sitter: ^0.21.1 }, so the grammar does not require a core past what is already pinned.
Risk
This changes which grammar the parser uses for Java and Python, so it is a correctness change and not only a packaging one. The parser suites need to run against the new grammars before it lands, and any IR difference has to be explained rather than blessed.
Scope
Pre-existing, independent of the engine packaging. Other platforms are unaffected: linux-x64, darwin-arm64, darwin-x64 and win32-x64 all install today from prebuilds with zero node-gyp runs.
npm installof the published package fails outright on linux-arm64. The engine half is fine; the install never reaches it.Symptom
On a clean arm64 machine with node and nothing else:
Installing a full build toolchain does not fix it. The failure moves to a nested copy and becomes:
Two causes
No arm64 prebuilds in the 0.21.x generation. Every native dependency falls back to node-gyp, which needs a compiler the user does not have.
A nested duplicate that cannot build.
tree-sitter-groovypinstree-sitter-java@0.23.4exactly while the parser asks for^0.21.0. The two ranges cannot both be satisfied, so npm nests a second copy, and the nested copy's gyp config resolvesnode-addon-apiby a relative path whose../count is wrong once nested. This is why a toolchain does not help. A caret range is not enough to dedupe either:^0.23.4resolves to 0.23.5 and nests again. The pin has to match exactly.Proposed fix
tree-sitter-java@0.23.4declarespeerDependencies { tree-sitter: ^0.21.1 }, so the grammar does not require a core past what is already pinned.Risk
This changes which grammar the parser uses for Java and Python, so it is a correctness change and not only a packaging one. The parser suites need to run against the new grammars before it lands, and any IR difference has to be explained rather than blessed.
Scope
Pre-existing, independent of the engine packaging. Other platforms are unaffected: linux-x64, darwin-arm64, darwin-x64 and win32-x64 all install today from prebuilds with zero node-gyp runs.