-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
Labels
windows
Issues and PRs related to the Windows platform.
Comments
hrishikesh-kadam
added
the
feature request
Issues that request new features to be added to Node.js.
label
Jul 16, 2022
aduh95
added
windows
Issues and PRs related to the Windows platform.
and removed
feature request
Issues that request new features to be added to Node.js.
labels
Jul 16, 2022
How did you install Node.js? |
@aduh95 Using |
/cc @nodejs/platform-windows |
@aduh95 I have found the issue. |
hrishikesh-kadam
added a commit
to hrishikesh-kadam/node
that referenced
this issue
Jul 17, 2022
This issue has been described in - nodejs#43860 On Windows system, git clone or git checkout on the repo turns LF line endings to CRLF in the worktree. This can happen due to many reasons like - - git config --system core.autocrlf (set to true) - git config --global core.autocrlf (set to true) - git config --local core.autocrlf (set to true) - git clone --config core.autocrlf=true ... Adding gitattributes for the shims will not convert them to CRLF line endings. Also, there is a note[1] in test/README.md which says - For the tests to run on Windows, be sure to clone Node.js source code with the `autocrlf` git config flag set to true. Reason for using build subsystem - These shims are just copied in stage_package label of vcbuild.bat Fixes: nodejs#43860 [1]: nodejs@3654cd4
nodejs-github-bot
pushed a commit
that referenced
this issue
Jul 19, 2022
This issue has been described in - #43860 On Windows system, git clone or git checkout on the repo turns LF line endings to CRLF in the worktree. This can happen due to many reasons like - - git config --system core.autocrlf (set to true) - git config --global core.autocrlf (set to true) - git config --local core.autocrlf (set to true) - git clone --config core.autocrlf=true ... Adding gitattributes for the shims will not convert them to CRLF line endings. Also, there is a note[1] in test/README.md which says - For the tests to run on Windows, be sure to clone Node.js source code with the `autocrlf` git config flag set to true. Reason for using build subsystem - These shims are just copied in stage_package label of vcbuild.bat Fixes: #43860 [1]: 3654cd4 PR-URL: #43879 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
danielleadams
pushed a commit
that referenced
this issue
Jul 26, 2022
This issue has been described in - #43860 On Windows system, git clone or git checkout on the repo turns LF line endings to CRLF in the worktree. This can happen due to many reasons like - - git config --system core.autocrlf (set to true) - git config --global core.autocrlf (set to true) - git config --local core.autocrlf (set to true) - git clone --config core.autocrlf=true ... Adding gitattributes for the shims will not convert them to CRLF line endings. Also, there is a note[1] in test/README.md which says - For the tests to run on Windows, be sure to clone Node.js source code with the `autocrlf` git config flag set to true. Reason for using build subsystem - These shims are just copied in stage_package label of vcbuild.bat Fixes: #43860 [1]: 3654cd4 PR-URL: #43879 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
targos
pushed a commit
that referenced
this issue
Jul 31, 2022
This issue has been described in - #43860 On Windows system, git clone or git checkout on the repo turns LF line endings to CRLF in the worktree. This can happen due to many reasons like - - git config --system core.autocrlf (set to true) - git config --global core.autocrlf (set to true) - git config --local core.autocrlf (set to true) - git clone --config core.autocrlf=true ... Adding gitattributes for the shims will not convert them to CRLF line endings. Also, there is a note[1] in test/README.md which says - For the tests to run on Windows, be sure to clone Node.js source code with the `autocrlf` git config flag set to true. Reason for using build subsystem - These shims are just copied in stage_package label of vcbuild.bat Fixes: #43860 [1]: 3654cd4 PR-URL: #43879 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
targos
pushed a commit
that referenced
this issue
Jul 31, 2022
This issue has been described in - #43860 On Windows system, git clone or git checkout on the repo turns LF line endings to CRLF in the worktree. This can happen due to many reasons like - - git config --system core.autocrlf (set to true) - git config --global core.autocrlf (set to true) - git config --local core.autocrlf (set to true) - git clone --config core.autocrlf=true ... Adding gitattributes for the shims will not convert them to CRLF line endings. Also, there is a note[1] in test/README.md which says - For the tests to run on Windows, be sure to clone Node.js source code with the `autocrlf` git config flag set to true. Reason for using build subsystem - These shims are just copied in stage_package label of vcbuild.bat Fixes: #43860 [1]: 3654cd4 PR-URL: #43879 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
targos
pushed a commit
that referenced
this issue
Aug 1, 2022
This issue has been described in - #43860 On Windows system, git clone or git checkout on the repo turns LF line endings to CRLF in the worktree. This can happen due to many reasons like - - git config --system core.autocrlf (set to true) - git config --global core.autocrlf (set to true) - git config --local core.autocrlf (set to true) - git clone --config core.autocrlf=true ... Adding gitattributes for the shims will not convert them to CRLF line endings. Also, there is a note[1] in test/README.md which says - For the tests to run on Windows, be sure to clone Node.js source code with the `autocrlf` git config flag set to true. Reason for using build subsystem - These shims are just copied in stage_package label of vcbuild.bat Fixes: #43860 [1]: 3654cd4 PR-URL: #43879 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Fyko
pushed a commit
to Fyko/node
that referenced
this issue
Sep 15, 2022
This issue has been described in - nodejs#43860 On Windows system, git clone or git checkout on the repo turns LF line endings to CRLF in the worktree. This can happen due to many reasons like - - git config --system core.autocrlf (set to true) - git config --global core.autocrlf (set to true) - git config --local core.autocrlf (set to true) - git clone --config core.autocrlf=true ... Adding gitattributes for the shims will not convert them to CRLF line endings. Also, there is a note[1] in test/README.md which says - For the tests to run on Windows, be sure to clone Node.js source code with the `autocrlf` git config flag set to true. Reason for using build subsystem - These shims are just copied in stage_package label of vcbuild.bat Fixes: nodejs#43860 [1]: nodejs@3654cd4 PR-URL: nodejs#43879 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
guangwong
pushed a commit
to noslate-project/node
that referenced
this issue
Oct 10, 2022
This issue has been described in - nodejs/node#43860 On Windows system, git clone or git checkout on the repo turns LF line endings to CRLF in the worktree. This can happen due to many reasons like - - git config --system core.autocrlf (set to true) - git config --global core.autocrlf (set to true) - git config --local core.autocrlf (set to true) - git clone --config core.autocrlf=true ... Adding gitattributes for the shims will not convert them to CRLF line endings. Also, there is a note[1] in test/README.md which says - For the tests to run on Windows, be sure to clone Node.js source code with the `autocrlf` git config flag set to true. Reason for using build subsystem - These shims are just copied in stage_package label of vcbuild.bat Fixes: nodejs/node#43860 [1]: nodejs/node@3654cd4 PR-URL: nodejs/node#43879 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What is the problem this feature will solve?
Line endings of the npm and other bash scripts are CRLF (\r\n) instead of LF (\n) in the Windows installation of the node.
Git Bash
This causes npm scripts unable to use on WSL distros like Ubuntu.
WSL Ubuntu 22.04 LTS
On Git Bash, the npm scripts with CRLF endings are interpreted without an issue.
Git Bash
What is the feature you are proposing to solve the problem?
Line endings of the npm and other bash scripts should be LF (\n) instead of CRLF (\r\n) in the Windows installation of the node.
What alternatives have you considered?
Using dos2unix.exe from Git Bash solves the issue.
Git Bash
WSL Ubuntu 22.04 LTS
Although,
corepack --version
in the above session fails due to another issue of missing node shim script pointing to node.exeOther 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.
The text was updated successfully, but these errors were encountered: