Skip to content

Instantly share code, notes, and snippets.

@ChanManChan
Last active February 12, 2020 17:44
Show Gist options
  • Select an option

  • Save ChanManChan/689d5879d749ca7404409f54982e16ec to your computer and use it in GitHub Desktop.

Select an option

Save ChanManChan/689d5879d749ca7404409f54982e16ec to your computer and use it in GitHub Desktop.

i'm on ubuntu for windows 10 (on a windows VM--i don't think the VM part matters though). i was getting the same errors as @RichiCoder1

: not foundram Files/nodejs/npm: 3: /mnt/c/Program Files/nodejs/npm:
: not foundram Files/nodejs/npm: 5: /mnt/c/Program Files/nodejs/npm:
/mnt/c/Program Files/nodejs/npm: 6: /mnt/c/Program Files/nodejs/npm: Syntax error: word unexpected (expecting "in")
i have node installed for windows (off the nodejs site). i kept it around, and in addition i followed @mrtopf's install instructions
$ curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
$ sudo apt-get install -y nodejs

then i made some changes to my PATH in my ~/.profile

PATH="$HOME/bin:$HOME/.local/bin:/usr/bin:$PATH"

and sourced it source ~/.profile

what i'm doing up there is telling bash where & in what order to look for my commands, separated by : so i'm saying first look in $HOME/bin then $HOME/.local/bin etc.

you should which npm and use the path where your ubuntu npm is. here's mine:

$ which npm
/usr/bin/npm

so i added /usr/bin to my PATH. /usr/bin needs to go BEFORE $PATH. i check that everything's OK now

$ whereis npm
npm: /usr/bin/npm /mnt/c/Program Files/nodejs/npm /mnt/c/Program Files/nodejs/npm.cmd

bash will use /usr/bin/npm before the npm in Program Files now i can npm install with no problems :-)


##Now for ZSH

zsh
chsh -s $(which zsh)
Logout from the system and login
Run terminal

##For zsh themes

source ~/.zshrc
nano ~/.zshrc
ZSH_THEME="powerlevel9k/powerlevel9k"

##For running Zsh by default [Hyper]

nano ~/.bashrc
save below line in the file (it boots zsh as the default shell on startup for hyper terminal automatically!)
bash -c zsh
also change the fontFamily to FiraCode for it to display proper Powerlevel9k as powerline fonts are failing to work

##For opening files through WSL in windows 10

cmd.exe /C start <file>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment