bash-lsp / ide-bash

Bash language support for Atom-IDE

Home Page:https://atom.io/packages/ide-bash

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Atom Error: Unable to start the Bash language server in Windows

roblogic opened this issue · comments

I get these errors when starting Atom (on Windows 10), or reloading the ide-bash plugin

  • "Unable to start the Bash language server, Please make sure you've followed the System Requirements section in the README"
  • "BashIDE language server for Shell Script unable to start, Error: spawn bash-language-server ENOENT"

image

Set up everything correctly AFAICT ,and I have just installed the latest release of Atom (1.27.2 x64)

( this issue is forked from comments in #2 )
( could be mitigated by #1 )
( seems quite similar to bash-lsp/bash-language-server#41 )

I think it's happening here in main.js. Maybe "spawn" isn't smart enough to find the npm package in windows

https://github.com/mads-hartmann/ide-bash/blob/ff7acfe95a37915ed8e1effe75df88e2b073c5e0/src/main.js#L29-L31

I found a couple of things to look into

A couple of alternatives to existing Node spawn on windows:

Has anyone tried??

(function() {
    var childProcess = require("child_process");
    var oldSpawn = childProcess.spawn;
    function mySpawn() {
        console.log('spawn called');
        console.log(arguments);
        var result = oldSpawn.apply(this, arguments);
        return result;
    }
    childProcess.spawn = mySpawn;
})();

As recommended in: https://stackoverflow.com/questions/27688804/how-do-i-debug-error-spawn-enoent-on-node-js

If so, what were the results?

Switching to using cross-spawn seems like the best options to me.

I've got the same issue on OSX 10.11.6 and Atom 1.29.0

screen shot 2018-08-20 at 17 43 27

I've got the same issue and I found a solution on Windows. In the following directory: C:\Users<user>.atom\packages\ide-bash\src you can find a main.js file. I changed the following line:
const command = 'bash-language-server.cmd'
After this change it works for me.

(Before this I tried papesch suggestions with windows-build-tools and superspawn from this page bash-lsp/bash-language-server#41 )

Same issue here.

I've got the same issue and I found a solution on Windows. In the following directory: C:\Users.atom\packages\ide-bash\src you can find a main.js file. I changed the following line:
const command = 'bash-language-server.cmd'
After this change it works for me.

(Before this I tried papesch suggestions with windows-build-tools and superspawn from this page mads-hartmann/bash-language-server#41 )

This should be a PR! I created one: #9