LunarVim / Neovim-from-scratch

📚 A Neovim config designed from scratch to be understandable
https://www.chrisatmachine.com/
GNU General Public License v3.0
5.4k stars 1.17k forks source link

Error during `npm install` (required for parser generation of phpdoc with npm dependencies) #226

Closed d13g0 closed 1 year ago

d13g0 commented 2 years ago

Hi Chris, I am following the video tutorials. I am at 08-treesitter. I get this message after checking out the branch:

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/odin/.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/odin/.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/odin/.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:1119:14)
npm ERR!     at Module._extensions..js (node:internal/modules/cjs/loader:1173:10)
npm ERR!     at Module.load (node:internal/modules/cjs/loader:997:32)
npm ERR!     at Module._load (node:internal/modules/cjs/loader:838:12)
npm ERR!     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
npm ERR!     at node:internal/main/run_main_module:18:47
npm ERR!
npm ERR! Node.js v18.9.1
npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/odin/.npm/_logs/2022-09-30T21_26_21_201Z-debug-0.log

I am on MacOS Monterey / Mac M1.

My current work around is to edit treesitter.lua like this:

ignore_install = {"phpdoc"}, 

As I don't need php. But just thought of sharing this in case there are any folks who could have this issue (or need to use phpdoc).

DemianKaled commented 2 years ago

Hey, where do you add the ignore_install = {"phpdoc"}, in code, cant fix the problem

d13g0 commented 2 years ago

Look for that line in treesitter.lua

DemianKaled commented 2 years ago

Look for that line in treesitter.lua

Screen Shot 2022-10-03 at 10 50 15

this one?

gnmearacaun commented 1 year ago

Thanks this should be resolved now. FYI Neovim v0.8.0 is patched recently to address treesitter error involving a mismatch between the bundled queries and the currently installed parsers.