You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Line endings of npm bash scripts is CRLF instead of LF in the Windows installation of node - /usr/bin/env: ‘bash\r’: No such file or directory #43860
This causes npm scripts unable to use on WSL distros like Ubuntu.
WSL Ubuntu 22.04 LTS
hrk@HRK-HPZBOOK:.../Program Files/nodejs$ pwd/mnt/c/Program Files/nodejshrk@HRK-HPZBOOK:.../Program Files/nodejs$ npm --version/usr/bin/env: ‘bash\r’: No such file or directoryhrk@HRK-HPZBOOK:.../Program Files/nodejs$ npx --version/usr/bin/env: ‘bash\r’: No such file or directoryhrk@HRK-HPZBOOK:.../Program Files/nodejs$ corepack --version-bash: /mnt/c/Program Files/nodejs/corepack: /bin/sh^M: bad interpreter: No such file or directory
On Git Bash, the npm scripts with CRLF endings are interpreted without an issue.
Other alternatives to installing node natively on WSL obviously solve the issue but it causes double dependencies of the core software and global packages, one on Windows and the other inside WSL.
Activity
aduh95 commentedon Jul 16, 2022
How did you install Node.js?
hrishikesh-kadam commentedon Jul 16, 2022
@aduh95 Using
https://nodejs.org/dist/v18.6.0/node-v18.6.0-x64.msias well aswinget install OpenJS.NodeJSaduh95 commentedon Jul 17, 2022
/cc @nodejs/platform-windows
hrishikesh-kadam commentedon Jul 17, 2022
@aduh95 I have found the issue.
Working on it locally.
I would like to have my first node contribution commit for this.
Please give me a day or 2.
build: add .gitattributes for npm and other shims
build: add .gitattributes for npm and other shims
build: add .gitattributes for npm and other shims
build: add .gitattributes for npm and other shims