-
Notifications
You must be signed in to change notification settings - Fork 788
[null-ls] failed to run generator: ...site\pack\packer\start\null-ls.nvim/lua/null-ls/loop.lua:165: command eslint_d is not executable (make sure it's installed and on your $PATH) #1118
Comments
Please do not delete the issue template - without that information there is nothing I can do about this. In addition to that, what does Neovim output when you run |
C:\Users\User\AppData\Roaming\npm\eslint_d |
Hi, I just encountered this issue and solved it with Yesterday, I installed eslint with It's very weird still, eslint and eslint_d both are executable globally in PowerShell, and in Neovim the output of Maybe it is Platform Info |
If it is a bug on our end, then it's a bug with the mechanism we use to spawn processes, in which case there's very little we can do about it. I believe this is somehow related to Node executables on Windows, but learning more will require deep investigation, and I don't have a Windows development environment to test this out for myself (and it also seems to be working without problems for most users). |
Definitely helpful, thanks for looking into this. I had thought that :exepath("F:\Workspace\medical-insurance\node_modules\.bin\stylelint") |
Is there Situation 1
In this situation, this issue comes out when I open a Situation 2
In this situation, this issue comes out too when I open a Situation 3
In this situation, this issue disappeares when I open a Situation 4But, after Situation 3, in Neovim Mason when I uninstall eslint_d, eslint_d runs well still in frontend project, the output is the same as Situation 3, until I delete
I checked related files in Maybe there are some other reasons and I'm working on solving the problem in Situation 4. UpdateFor Situation 4, after I uninstalled eslint_d locally in my frontend project |
Haha, yes, sorry, too much time spent in Lua. Thanks for the thorough investigation! I'm actually not sure how Mason is interacting with things here, but I did think of a potential issue with null-ls core: For most Node-based sources, we use this logic to determine whether a local executable is present. When combined with this wrapper, it means that if you're using the If the issue is that null-ls is pointing at a shell script that Windows can't execute, and if the issue is specific to Node-based sources, then this patch may help. Could you give it a shot and let me know! diff --git a/lua/null-ls/helpers/command_resolver.lua b/lua/null-ls/helpers/command_resolver.lua
index 66af8df..30942a0 100644
--- a/lua/null-ls/helpers/command_resolver.lua
+++ b/lua/null-ls/helpers/command_resolver.lua
@@ -1,6 +1,8 @@
local cache = require("null-ls.helpers.cache")
local u = require("null-ls.utils")
+local is_windows = vim.loop.os_uname().version:match("Windows")
+
local M = {}
--- search for a local executable and its parent directory from start_path to end_path
@@ -46,7 +48,11 @@ end
M.from_node_modules = function()
local node_modules_resolver = M.generic(u.path.join("node_modules", ".bin"))
return function(params)
- return node_modules_resolver(params) or params.command
+ local resolved_command = node_modules_resolver(params)
+ if resolved_command and is_windows then
+ resolved_command = u.path.join(resolved_command, ".cmd")
+ end
+ return resolved_command or params.command
end
end
|
Yes, this patch solved current issue. And this line
should actually be
or In addition, under this patch, |
Ah, yeah, my bad. Is there any documentation about how |
I've been looking for that documentation after I tried this patch. I'm not very familiar with npm executable script creation mechanism. I will let you know if I find it. |
Hi, @jose-elias-alvarez I found how does npm determine the executable file. https://github.com/npm/libnpmexec/blob/e1378fc8b8e2243765b068d8eb45aba7d01d45bd/lib/index.js#L38 const exec = async (opts) => {
const {
args = [],
call = '',
color = false,
localBin = resolve('./node_modules/.bin'),
locationMsg = undefined,
globalBin = '',
output,
packages: _packages = [],
path = '.',
runPath = '.',
scriptShell = isWindows ? process.env.ComSpec || 'cmd' : 'sh',
yes = undefined,
...flatOptions
} = opts So the patch is correct. I create a new PR for it. #1341 |
Nvim version:
v0.8.0-dev-1112-g6d557e324 #1118
[null-ls] failed to run generator: ...site\pack\packer\start\null-ls.nvim/lua/null-ls/loop.lua:165: command eslint_d is not executable (make sure it's installed and on your $PATH)
Every single time I go into a .jsx file of my NextJS project, I see this message. The linter does not work indeed.
I use the well-known Devaslife's config: https://github.com/craftzdog/dotfiles-public
eslint_d
is in my environment variables:The text was updated successfully, but these errors were encountered: