castwide / vscode-solargraph

A Visual Studio Code extension for Solargraph.
Other
423 stars 25 forks source link

Can't start Plugin - Cannot find module 'semver' #136

Closed jcat4 closed 5 years ago

jcat4 commented 5 years ago

I'm recently got back into messing with Ruby and noticed that basic Intellisense, such as things like String method suggestions, were not working.

The Dev console gives the following error on startup: Activating extension 'castwide.solargraph' failed: Cannot find module 'semver'. _logMessageInConsole @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:3210

I've tried installing the solargraph gem, setting the solargraph.commandPath to the output of which solargraph, which turned out to be /Users/joey/.rvm/gems/ruby-2.6.2/bin/solargraph, and twiddling with a few settings here and there. I also tried trimming out some older settings, purging other extensions (rails, bust-a-gem, etc.), and even tried reinstalling VS Code. Restarts have not helped, either.

Running on Mac OS 10.14.5, zsh, VS Code version 1.36.1

settings.json:

{
    "resmon.showbattery": false,
    "resmon.showcpuusage": false,
    "git.autofetch": true,
    "workbench.iconTheme": "eq-material-theme-icons-light",

    "emmet.includeLanguages": {
        "liquid": "html",
        "erb": "html"
    },
    "files.associations": {
        "*.scss.liquid": "scss"
    },
    "liveServer.settings.donotVerifyTags": true,
    "solargraph.commandPath": "/Users/joey/.rvm/gems/ruby-2.6.2/bin/solargraph"
}

Any ideas? Google wasn't super helpful for me...

castwide commented 5 years ago

I haven't seen that error, but this Stack Overflow discussion might be related. (The solution there suggests reinstalling Node.)

jcat4 commented 5 years ago

I haven't seen that error, but this Stack Overflow discussion might be related. (The solution there suggests reinstalling Node.)

Thanks for getting back to me so quickly! Unfortunately, nothing is working so far. 😟I've tried deleting npm cache, validating semver is installed globally, uninstalling and reinstalling node (using brew and also rm rf'ing the output of which node), etc., but the pesky "Cannot find module 'semver'" keeps popping up.

I tried to make sure no electron or other node processes were running on my machine when I removed everything, just to try and be safe...

jcat4 commented 5 years ago

I got it working. 😀 I don't know what the issue was. I went in a manually nuked ALL of my extensions (rm -rf ~/.vscode/extensions) and reinstalled just the ruby language service and solargraph extensions, and it worked? I guess something else in there was messing with it. 🤷‍♂️