5

I'm trying to set up nvim on my MBP, and everything went well except for the last step, which is installing nvim-treesitter, after a short installing routine it throws this error:

nvim-treesitter[phpdoc]: Error during `npm install` (required for parser generation of phpdoc with npm dependencies)
npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
npm ERR! code 1
npm ERR! path /Users/anton/.local/share/nvim/tree-sitter-phpdoc/node_modules/tree-sitter-cli
npm ERR! command failed
npm ERR! command sh -c node install.js
npm ERR! /Users/anton/.local/share/nvim/tree-sitter-phpdoc/node_modules/tree-sitter-cli/install.js:24
npm ERR!   throw new Error(`Cannot install tree-sitter-cli for architecture ${process.arch}`);
npm ERR!   ^
npm ERR!
npm ERR! Error: Cannot install tree-sitter-cli for architecture arm64
npm ERR!     at Object.<anonymous> (/Users/anton/.local/share/nvim/tree-sitter-phpdoc/node_modules/tree-sitter-cli/install.
js:24:9)
npm ERR!     at Module._compile (node:internal/modules/cjs/loader:1105:14)
npm ERR!     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
npm ERR!     at Module.load (node:internal/modules/cjs/loader:981:32)
npm ERR!     at Function.Module._load (node:internal/modules/cjs/loader:822:12)
npm ERR!     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
npm ERR!     at node:internal/main/run_main_module:17:47
npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/anton/.npm/_logs/2022-07-07T19_21_36_165Z-debug-0.log

Did someone found a fix for that? Frankly, I'm not very deep into arch and compiller stuff, so I can assume I'm missing something on a surface.

flppv
  • 4,111
  • 5
  • 35
  • 54
  • I ended up installing fresh neovim via brew and it was installed without errors, just ```brew install neovim``` – flppv Nov 09 '22 at 16:53

2 Answers2

3

It seems like phpdoc doesn't work on Apple Silicon. You may ignore phpdoc parser to workaround if you're not using it: ignore_install = { "phpdoc" }, Or use quick fix from github issue

0

Your issue seems related to the architecture. You may try to install it with brew:

$ brew install neovim

You may also follow this blog post with some adaptations:

$ xcode-select --install
$ brew unlink tree-sitter
$ arch -arm64 brew install --HEAD tree-sitter
$ brew unlink nvim
$ arch -arm64 brew install --HEAD nvim
Nicolas Dupouy
  • 450
  • 1
  • 7
  • 11