Giter Site home page Giter Site logo

Comments (20)

jorgebucaran avatar jorgebucaran commented on May 28, 2024 1

I suggest addressing the first issue on your list to start with. Fish should work consistently with WebStorm, rather than sporadically. For what it's worth, I use Visual Studio Code and have not encountered any problems.

from nvm.fish.

jorgebucaran avatar jorgebucaran commented on May 28, 2024 1

I'm going to mark this as stale and close it, as it doesn't seem to be directly related to nvm.fish. Let me know if you have any other questions. Thanks!

from nvm.fish.

termosa avatar termosa commented on May 28, 2024

Killing all VSCode processes has helped
Sometimes you just need to restart tools 🤷

from nvm.fish.

termosa avatar termosa commented on May 28, 2024

But now the system node has priority over the nvm version
CleanShot 2023-02-22 at 20 49 02@2x

from nvm.fish.

jorgebucaran avatar jorgebucaran commented on May 28, 2024

Only in VSCode?

from nvm.fish.

treykasada avatar treykasada commented on May 28, 2024

I've just set up a new MacBook and I might be having the same problem in WebStorm. 😞

I tried checking the environment in both my regular terminal and the WebStorm integrated terminal, and it looks like nvm isn't being loaded at all in WebStorm:

WebStorm integrated terminal

> ps -f | string match --all '*fish*'

  502  3935  3872   0  3:51PM ttys000    0:00.03 /opt/homebrew/bin/fish --login -i
> set --show | string match --all '*nvm*'

Regular terminal

> ps -f | string match --all '*fish*'

  502  2318  2316   0  3:29pm ttys000    0:00.90 /opt/homebrew/bin/fish --login --init-command printf '\x1b\x50\x24\x647b22686f6f6b223a2022496e69745368656c6c222c202276616c7565223a207b227368656c6c223a202266697368227d7d\x9c'
> set --show | string match --all '*nvm*'

$PATH[1]: |/Users/username/.local/share/nvm/v18.14.2/bin|
$_fisher_jorgebucaran_2F_nvm_2E_fish_files: set in universal scope, unexported, with 7 elements
$_fisher_jorgebucaran_2F_nvm_2E_fish_files[1]: |~/.config/fish/functions/_nvm_index_update.fish|
$_fisher_jorgebucaran_2F_nvm_2E_fish_files[2]: |~/.config/fish/functions/_nvm_list.fish|
$_fisher_jorgebucaran_2F_nvm_2E_fish_files[3]: |~/.config/fish/functions/_nvm_version_activate.fish|
$_fisher_jorgebucaran_2F_nvm_2E_fish_files[4]: |~/.config/fish/functions/_nvm_version_deactivate.fish|
$_fisher_jorgebucaran_2F_nvm_2E_fish_files[5]: |~/.config/fish/functions/nvm.fish|
$_fisher_jorgebucaran_2F_nvm_2E_fish_files[6]: |~/.config/fish/conf.d/nvm.fish|
$_fisher_jorgebucaran_2F_nvm_2E_fish_files[7]: |~/.config/fish/completions/nvm.fish|
$_fisher_plugins[2]: |jorgebucaran/nvm.fish|
$nvm_current_version: set in global scope, exported, with 1 elements
$nvm_current_version[1]: |v18.14.2|
$nvm_data: set in universal scope, unexported, with 1 elements
$nvm_data[1]: |/Users/username/.local/share/nvm|
$nvm_default_version: set in universal scope, unexported, with 1 elements
$nvm_default_version[1]: |lts|
$nvm_mirror: set in universal scope, unexported, with 1 elements
$nvm_mirror[1]: |https://nodejs.org/dist|

This is a fresh setup. Fish installed via Homebrew.

from nvm.fish.

treykasada avatar treykasada commented on May 28, 2024

Ugh, scratch that. Disabling Shell integration in WebStorm seems to fix the problem:
image
No idea what that's doing to prevent nvm from loading. 🤷

from nvm.fish.

treykasada avatar treykasada commented on May 28, 2024

Ahh, but WebStorm unfortunately still can't auto-detect the path to the node executable. 😞
image
Probably need something like NVM_SYMLINK_CURRENT for that, but that's a separate feature request.

from nvm.fish.

jorgebucaran avatar jorgebucaran commented on May 28, 2024

Are you using nvm.fish or nvm.sh?

from nvm.fish.

treykasada avatar treykasada commented on May 28, 2024

nvm.fish

from nvm.fish.

jorgebucaran avatar jorgebucaran commented on May 28, 2024

Is Fish your main shell? Is Web Storm configured to use Fish as its default shell?

from nvm.fish.

treykasada avatar treykasada commented on May 28, 2024

Yep and yep. 🙂

from nvm.fish.

jorgebucaran avatar jorgebucaran commented on May 28, 2024

And this problem only occurs inside Web Storm? At this point, I'd have to look at your config.fish.

from nvm.fish.

treykasada avatar treykasada commented on May 28, 2024

Tbh WebStorm is the only editor I have installed right now, so I'm honestly not sure if this is a WebStorm-specific issue. 🤷

For config.fish though:

> cat ~/.config/fish/config.fish

if status is-interactive
    # Commands to run in interactive sessions can go here
end

Is it supposed to have more in it?

from nvm.fish.

jorgebucaran avatar jorgebucaran commented on May 28, 2024

No, you are not supposed to have anything in it specifically for nvm.fish, I was just wondering if there might be something in there conflicting with nvm.fish, but that doesn't appear to be the case.

Can you reproduce the issue outside Web Storm, i.e. in your terminal?

from nvm.fish.

treykasada avatar treykasada commented on May 28, 2024

Terminal is fine; both nvm install/use and $nvm_default_version seem to work as expected. 👍

from nvm.fish.

termosa avatar termosa commented on May 28, 2024

I still have it in VSCode (also with shell integration enabled). Does it count as the case outside of WebStorm?

from nvm.fish.

termosa avatar termosa commented on May 28, 2024

Temporarily fixed it for me:

code $__fish_config_dir/config.fish                 
    if status is-interactive
        # Commands to run in interactive sessions can go here
+       nvm use > /dev/null 2>&1
    end

from nvm.fish.

treykasada avatar treykasada commented on May 28, 2024

Including nvm use in config.fish unfortunately doesn't solve the problem for WebStorm - it's still unable to automatically find the node path. 😢

I did some further investigation:

If I have nvm use in config.fish, leave Shell integration disabled (as mentioned above), and open WebStorm's integrated terminal, I see a "Now using Node v..." message. So config.fish is at least running when opening WebStorm's terminal. But that doesn't seem to help with the IDE's auto-detection of node. 🤷

Interestingly, if I have nvm use in config.fish, re-enable Shell integration, and open WebStorm's integrated terminal, I see an "Can't use Node ..., version must be installed first" error instead, even if that Node version is installed.
So something about WebStorm's Shell integration is preventing nvm from accessing its installed node versions. Not sure if that's related to the node path auto-detection issues or not.

from nvm.fish.

connorjs avatar connorjs commented on May 28, 2024

I'm not sure if this is the plugin, fish, or VSCode problem but maybe somebody here can address me.

This seems to be IDE side. I also am having issues (WebStorm for me). I normally have just accepted workarounds as reality but spent a good hour debugging random stuff today related to this. Some findings (no solutions)

  • I have WebStorm set to use fish, but it only does sometimes
  • For example, the terminal works perfect, including with nvm. (Settings > Tools > Terminal > Shell path: /opt/homebrew/bin/fish)
  • But running file watchers do not work. echo $SHELL prints path to fish, but it is running in some sort of POSIX syntax.
  • To fix file watchers, I created one-off script files with specific shebang line
    #!/opt/homebrew/bin/fish
    nvm use
    npx stylelint $argv
    
  • Running which node for a file watcher failed and echo $PATH only used the system path

🤷🏻‍♂️

from nvm.fish.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.