Skip to content

Instantly share code, notes, and snippets.

@chankruze
Last active August 31, 2022 00:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chankruze/7de44914225e698c3b8cfb76c3a04d8b to your computer and use it in GitHub Desktop.
Save chankruze/7de44914225e698c3b8cfb76c3a04d8b to your computer and use it in GitHub Desktop.

fix: /usr/bin/env: ‘bash\r’: No such file or directory

Check your path, echo $PATH. WSL2 normally imports Windows path there. To fix this create file /etc/wsl.conf in WSL2:

[interop]
appendWindowsPath = false

Then restart WSL2 with wsl --shutdown. Then check your path is shorter now and doesn't include any Windows dependencies: echo $PATH

source: github

fix: zsh: command not found: npm

Add follwing to ~/.zshrc:

export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

source: stack overflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment