You should have the oh-my-zsh installed. Then, in the terminal configuration, use the Hack-Font that you have downloaded from this repo Refer to Powerlevel10k Documentation for more information
- To see all zsh aliases, run
help-shell
on terminal - To see all git aliases, run
help-git
on terminal
Sometime, npm
is linked to the NodeJS installed on your Windows, which can cause conflict in the WSL2 Ubuntu
This is the instruction if you are running into the permission error when running npm
, it is recommended that you re-install node
with nvm
first:
- Run the command to export the
$PATH
ofnpm
to your local environment:
nano ~/.bash_profile
Add below lines to the .bash_profile
file:
export PATH="$HOME/.npm-packages/bin:$PATH"
- Save the file and re-check:
cat .bash_profile
- [OPTIONAL] Add below line to both
.bash_profile
and.bashrc
(or.zshrc
):
export NVM_DIR=~/.nvm
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
- Reset the local environment to update the changes:
source ~/.bash_profile
source ~/.bashrc
source ~/.zshrc
- [OPTIONAL] Restart your machine
This guide provides steps to uninstall Node.js and npm from your WSL Ubuntu and Windows system.
- Uninstalling from WSL Ubuntu
- Remove the installed Node.js package:
sudo apt-get remove nodejs
- Remove the installed npm package:
sudo apt-get remove npm
- Remove Node.js directories. These directories may contain npm packages installed globally on your system. You can remove them using the following commands:
sudo rm -rf /usr/local/lib/nodejs
sudo rm -rf ~/.npm
- Check if Node.js and npm are uninstalled. You can do this by running the following commands:
node -v
npm -v
If Node.js and npm are successfully uninstalled, these commands should not return any version number.
If Node.js and npm are still present on your system, it's possible that they were installed in a different location that's still in your system's PATH. You can check where npm is installed by using the which
command:
which npm
This will return the path where npm is currently installed. You can then remove the npm and Node.js binaries from that location. Please be careful while doing this and ensure that you are removing the correct files.
Also, remember to close and reopen your terminal or run source ~/.bashrc
to make sure your changes are being recognized.
- Uninstalling from Windows System
If Node.js and npm are installed in your Windows system, you can uninstall them from the Windows "Add or Remove Programs" settings:
- Open the Start Menu and search for "Add or Remove Programs".
- In the list of installed programs, look for Node.js and click on it.
- Click on the "Uninstall" button that appears.
Please note that this will only uninstall Node.js and npm from your Windows system. If you have Node.js and npm installed in other environments (like WSL), those installations will not be affected. Also, remember to backup any important data before uninstalling.
This guide provides steps to install Node.js and npm in your system using the Node Version Manager (nvm).
Replace zsh
with bash
if you don't have OhMyZsh on your WSL2, however, it is highly recommended to do so!
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | zsh
source ~/.zshrc
nvm install node
-
Download and install nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | zsh
This command downloads the nvm install script from the project's GitHub page and executes it. The
v0.38.0
in the URL should be replaced with the latest version of nvm, which can be found on the nvm GitHub page. -
Activate nvm:
source ~/.zshrc
This command activates nvm by loading the nvm script into your current shell session. You need to run this command in any new shell session before you can use nvm.
-
Install Node.js and npm:
nvm install node
This command installs the latest version of Node.js and npm. If you want to install a specific version of Node.js, you can replace
node
with the version number. For example,nvm install 14.15.1
would install Node.js version 14.15.1 and the corresponding npm version.
After following these steps, you can verify the installation by checking the versions of Node.js and npm:
node -v
npm -v