Skip to main content
Post Undeleted by harrymc
added 471 characters in body
Source Link
harrymc
  • 1
  • 31
  • 579
  • 995

The error message suggests that the script you're invoking has embedded \r characters, whichThis problem is mentioned in turn suggests that it has Windows-style \r\n line endings, instead of the Linux-stylefollowing sources, where various \n-only line endings thatsolutions were suggested:

This might be enough bash expects.:

  1. From WSL run sudo apt install nodejs npm to install node & npm
  2. From PowerShell/CMD run wsl --shutdown to restart the WSL service
  3. Next in WSL run which npm to confirm it's installed [output: /usr/bin/npm]

As a quick fixIf this doesn't solve the issue, you can removeother solutions are suggested in the \r charsabove sources. as follows:

sed $'s/\r$//' input-file > output-file

The error message suggests that the script you're invoking has embedded \r characters, which in turn suggests that it has Windows-style \r\n line endings, instead of the Linux-style \n-only line endings that bash expects.

As a quick fix, you can remove the \r chars. as follows:

sed $'s/\r$//' input-file > output-file

This problem is mentioned in the following sources, where various solutions were suggested:

This might be enough :

  1. From WSL run sudo apt install nodejs npm to install node & npm
  2. From PowerShell/CMD run wsl --shutdown to restart the WSL service
  3. Next in WSL run which npm to confirm it's installed [output: /usr/bin/npm]

If this doesn't solve the issue, other solutions are suggested in the above sources.

Post Deleted by harrymc
Source Link
harrymc
  • 1
  • 31
  • 579
  • 995

The error message suggests that the script you're invoking has embedded \r characters, which in turn suggests that it has Windows-style \r\n line endings, instead of the Linux-style \n-only line endings that bash expects.

As a quick fix, you can remove the \r chars. as follows:

sed $'s/\r$//' input-file > output-file