如何在Apple Silicon(M1 Max)上安装NVIM-Treesitter?获取错误:无法安装架构ARM64的架构-CLI
我正在尝试在我的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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的问题似乎与架构有关。您可以尝试使用
brew
:您也可以按照此
Your issue seems related to the architecture. You may try to install it with
brew
:You may also follow this blog post with some adaptations:
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