Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
roblogic opened this issue Jun 1, 2018 · 6 comments · Fixed by #9
Closed

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

roblogic opened this issue Jun 1, 2018 · 6 comments · Fixed by #9
Labels
help wanted Extra attention is needed

Comments

@roblogic
Copy link

roblogic commented Jun 1, 2018

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

@roblogic roblogic changed the title Atom Error: Unable to start the Bash language server Atom Error: Unable to start the Bash language server in Windows Jun 1, 2018
@mads-hartmann mads-hartmann added the help wanted Extra attention is needed label Jun 1, 2018
@roblogic
Copy link
Author

roblogic commented Jun 4, 2018

A couple of alternatives to existing Node spawn on windows:

@jason-c-daniels
Copy link

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?

@mads-hartmann
Copy link
Collaborator

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

@buchdag
Copy link

buchdag commented Aug 20, 2018

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

@hgeri95
Copy link

hgeri95 commented Oct 10, 2018

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 )

@aminya
Copy link
Contributor

aminya commented Feb 18, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants