Skip to content

Instantly share code, notes, and snippets.

@r-this
Last active August 24, 2023 23:57
Show Gist options
  • Save r-this/7d47c23c1a93f6553efebd4be04e3a35 to your computer and use it in GitHub Desktop.
Save r-this/7d47c23c1a93f6553efebd4be04e3a35 to your computer and use it in GitHub Desktop.
npm error: /usr/bin/env: ‘bash\r’: No such file or directory

NPM Install Error

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

Error running the following commands in WSL2 (e.g. VS Code WSL2 bash or zsh terminal)

npm install
npm
npm start
npm run start

Fix

  1. VS Code WSL: sudo apt install nodejs npm
  2. PowerShell: wsl --shutdown
  3. VS Code WSL: Reload Window
  4. Vs Code WSL: npm # test

Thank YOU

https://superuser.com/questions/1769945/how-to-fix-npm-issue-on-wsl

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