summaryrefslogtreecommitdiff
path: root/lua/nvim-treesitter/install.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/nvim-treesitter/install.lua')
-rw-r--r--lua/nvim-treesitter/install.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua
index 655e82a3..7380934e 100644
--- a/lua/nvim-treesitter/install.lua
+++ b/lua/nvim-treesitter/install.lua
@@ -184,6 +184,10 @@ local function run_install(cache_folder, install_folder, lang, repo, with_sync,
end
if generate_from_grammar then
if repo.generate_requires_npm then
+ if not vim.fn.executable('npm') ~= 1 then
+ api.nvim_err_writeln('`'..lang..'` requires NPM to be installed from grammar.js')
+ return
+ end
vim.list_extend(command_list, {
{
cmd = 'npm',