exercism / cli

A Go based command line tool for exercism.org.
https://exercism.org/docs/using/solving-exercises/working-locally
MIT License
1.33k stars 357 forks source link

CLI install breaking stuff on WSL! #848

Closed spences10 closed 5 years ago

spences10 commented 5 years ago

Hi,

Installing the CLI has broken some parts of my shell now, let me know what details would be helpful and I'll provide them happily.

Background

Followed the guide on the site and installed with no issues

Environment

I'm using Windows Subsystem Linux (WSL) with fish shell, but to install the CLI I used bash.

As I'm on WSL it's more performant to use n for node version management instead of nvm more on this later.

No LSB modules are available. 
Distributor ID: Ubuntu
Description:    Ubuntu 18.10
Release:        18.10
Codename:       cosmic

What's the probs yo!?

On each shell a launch I like to add my ssh key to the agent, I use the following snippet in my ~/.bashrc file:

if [ -z "$SSH_AUTH_SOCK" ] ; then
  eval `ssh-agent -s` 
  ssh-add
fi

I'm no longer prompted for this, which is slightly concerning, what happened to my .bashrc?, also I notice a lot of the options I have enabled in there aren't enabled so looks like it's not loading?

Changing to fish I get prompts saying my node can't be found 🤔

Command 'node' not found, but can be installed with: 

sudo apt install nodejs

~/.local/share/omf/themes/one/fish_right_prompt.fish (line 1): 
node --version 
^
in command substitution
        called on line 21 of file ~/.local/share/omf/themes/one/fish_right_prompt.fish

in function 'fish_right_prompt'
        called on standard input

in command substitution
        called on standard input

Pretty broken now 😢

Let me know if there's anything else you need, in the meantime I'm going to have to reset my Ubuntu install now and start again.

cmccandless commented 5 years ago

If you still have the problematic environment, can you please provide the output for the following commands?

  1. echo $PATH
  2. cat ~/.bashrc (Please censor any private information, passwords, keys, etc.)
  3. env (Please censor any private information, passwords, keys, etc.)
spences10 commented 5 years ago

Sorry that info isn't available now:

Let me know if there's anything else you need, in the meantime I'm going to have to reset my Ubuntu install now and start again.

tehsphinx commented 5 years ago

The CLI is a Go program. All the installer needs to do is put the binary somewhere and add it's folder to the $PATH environment variable. There are no other dependencies and no other changes to be made.

I can not see how that could mess up WSL in the way you described. Probably something else caused this behaviour.

spences10 commented 5 years ago

Probably 🤷

It was the only thing I was doing at the time and it's put me off of wanting to attempt repeating the process now.

Could it have messed up my path? Sounds like it may have if I couldn't use anything from my .bashrc

Also the issue is closed, so it's here for information more than anything else rn. 👍

Thanks for the CLI I'm sure a lot of users get a lot of value out if it.

tehsphinx commented 5 years ago

It might have happened due to switching shells as you described using bash for the install and fish otherwise. But I can't test that as I'm not on windows.

But as you said: this is already closed. Just in case someone else stumbles on this we will investigate further.

darrylmorley commented 1 year ago

I also have an issue with the exercism breaking stuff in WSL2. Node is gone, nvm is gone. A new nvm install won't stick. Very strange? I don't really know how to resolve this.

SleeplessByte commented 1 year ago

@darrylmorley this issue was closed 4 years ago. You're better of asking the question at https://forum.exercism.org/. That said, the Exercism CLI does not modify the PATH (env), so it couldn't/shouldn't be the cause for what it is that you're experiencing.

darrylmorley commented 1 year ago

@darrylmorley this issue was closed 4 years ago. You're better of asking the question at https://forum.exercism.org/. That said, the Exercism CLI does not modify the PATH (env), so it couldn't/shouldn't be the cause for what it is that you're experiencing.

Hi @SleeplessByte, I've solved my problem now thanks. The issue relates to a file created by the exercism CLI, I think the .bash_profile file? I can't remember exactly as I installed it a few days ago now. This prevents bash from loading in WSL.

To fix just add source ~/.bashrc to the end of the .bash_profile file.

This may be helpful for others that might come across the same issue.