From f392f13af41444920ebbb0a41f07a4843761abe6 Mon Sep 17 00:00:00 2001 From: Stephan Seitz Date: Tue, 16 Mar 2021 05:02:03 +0100 Subject: Add an error message if NPM is not available but needed --- lua/nvim-treesitter/install.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lua/nvim-treesitter/install.lua') 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', -- cgit v1.2.3