如何在Apple Silicon(M1 Max)上安装NVIM-Treesitter?获取错误:无法安装架构ARM64的架构-CLI

发布于 2025-02-13 19:58:25 字数 1753 浏览 0 评论 0原文

我正在尝试在我的MBP上设置NVIM,除了安装NVIM-Treesitter的最后一步之外,一切都做得很好

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

。坦率地说,我对拱门和组合物的东西不是很深,所以我可以假设我缺少表面上的东西。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

孤独陪着我 2025-02-20 19:58:27

您的问题似乎与架构有关。您可以尝试使用brew

$ brew install neovim

您也可以按照此

$ xcode-select --install
$ brew unlink tree-sitter
$ arch -arm64 brew install --HEAD tree-sitter
$ brew unlink nvim
$ arch -arm64 brew install --HEAD nvim

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
给妤﹃绝世温柔 2025-02-20 19:58:26

PHPDOC似乎对Apple Silicon不起作用。
如果您不使用它,您可能会忽略PHPDOC解析器的解决方法:
ignore_install = {“ phpdoc”},
或使用github evary

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文