Skip to content
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

node shell shim missing in Windows installation node, required for WSL #43861

Closed
hrishikesh-kadam opened this issue Jul 16, 2022 · 4 comments · May be fixed by #43948
Closed

node shell shim missing in Windows installation node, required for WSL #43861

hrishikesh-kadam opened this issue Jul 16, 2022 · 4 comments · May be fixed by #43948
Labels
feature request Issues that request new features to be added to Node.js. stale windows Issues and PRs related to the Windows platform.

Comments

@hrishikesh-kadam
Copy link
Contributor

What is the problem this feature will solve?

In the Windows installation of node, shell shim is missing which points to the node.exe required for using from WSL distros.

WSL Ubuntu 22.04 LTS
hrk@HRK-HPZBOOK:.../Program Files/nodejs$ pwd
/mnt/c/Program Files/nodejs

hrk@HRK-HPZBOOK:.../Program Files/nodejs$ \ls -alFh
total 62M
dr-xr-xr-x 1 hrk hrk 4.0K Jul 16 21:18 ./
dr-xr-xr-x 1 hrk hrk 4.0K Jul 16 16:46 ../
-r-xr-xr-x 1 hrk hrk  322 Jul 16 20:27 corepack*
-r-xr-xr-x 1 hrk hrk  218 Jul  8 06:00 corepack.cmd*
-r-xr-xr-x 1 hrk hrk 3.0K Jul  8 06:00 install_tools.bat*
-r-xr-xr-x 1 hrk hrk 8.8K Oct 14  2021 node_etw_provider.man*
-r-xr-xr-x 1 hrk hrk  62M Jul 13 14:32 node.exe*
dr-xr-xr-x 1 hrk hrk 4.0K Jul 16 16:34 node_modules/
-r-xr-xr-x 1 hrk hrk  702 Oct 14  2021 nodevars.bat*
-r-xr-xr-x 1 hrk hrk 1.4K Jul 16 20:27 npm*
-r-xr-xr-x 1 hrk hrk  483 Jul  7 06:00 npm.cmd*
-r-xr-xr-x 1 hrk hrk 1.6K Jul 16 20:27 npx*
-r-xr-xr-x 1 hrk hrk  539 Jul  7 06:00 npx.cmd*

hrk@HRK-HPZBOOK:.../Program Files/nodejs$ node --version
-bash: /mnt/c/Program Files/nodejs/node: No such file or directory

hrk@HRK-HPZBOOK:.../Program Files/nodejs$ node.exe --version
v18.6.0

Git Bash can run the node --version command without appending .exe to the node as expected.

Git Bash
hrkad@HRK-HPZBOOK MINGW64 /c/Program Files/nodejs
$ node --version
v18.6.0

hrkad@HRK-HPZBOOK MINGW64 /c/Program Files/nodejs
$ node.exe --version
v18.6.0

What is the feature you are proposing to solve the problem?

There are two ways to solve this issue.

  1. By creating shell shim node passing arguments to node.exe
WSL Ubuntu 22.04 LTS -> Run as administrator
hrk@HRK-HPZBOOK:.../Program Files/nodejs$ cat > node <<EOL
#!/bin/sh
node.exe "\$@"
EOL

hrk@HRK-HPZBOOK:.../Program Files/nodejs$ cat node
#!/bin/sh
node.exe "$@"

hrk@HRK-HPZBOOK:.../Program Files/nodejs$ node --version
v18.6.0
  1. By creating a symlink node pointing to node.exe
Command Prompt -> Run as administrator
C:\Program Files\nodejs>mklink node node.exe
symbolic link created for node <<===>> node.exe

C:\Program Files\nodejs>dir
 Volume in drive C is Windows
 Volume Serial Number is XXXX-XXXX

 Directory of C:\Program Files\nodejs

16/07/2022  09:48 PM    <DIR>          .
16/07/2022  04:46 PM    <DIR>          ..
16/07/2022  08:27 PM               322 corepack
08/07/2022  06:00 AM               218 corepack.cmd
08/07/2022  06:00 AM             3,033 install_tools.bat
16/07/2022  09:48 PM    <SYMLINK>      node [node.exe]
13/07/2022  02:32 PM        64,891,000 node.exe
14/10/2021  12:30 AM               702 nodevars.bat
14/10/2021  12:30 AM             8,997 node_etw_provider.man
16/07/2022  04:34 PM    <DIR>          node_modules
16/07/2022  08:27 PM             1,365 npm
07/07/2022  06:00 AM               483 npm.cmd
16/07/2022  08:27 PM             1,567 npx
07/07/2022  06:00 AM               539 npx.cmd
              11 File(s)     64,908,226 bytes
               3 Dir(s)  252,773,011,456 bytes free
WSL Ubuntu 22.04 LTS
hrk@HRK-HPZBOOK:.../Program Files/nodejs$ node --version
v18.6.0

What alternatives have you considered?

Installing node natively on WSL obviously solves the issue but it causes double dependencies of the core software and global packages, one on Windows and the other inside WSL.

@MoLow
Copy link
Member

MoLow commented Jul 17, 2022

/cc @nodejs/platform-windows

@hrishikesh-kadam
Copy link
Contributor Author

@MoLow @nodejs/platform-windows
I would like to have a contribution for this once #43860 has been taken care of.

hrishikesh-kadam added a commit to hrishikesh-kadam/node that referenced this issue Jul 22, 2022
This issue has been described in -
nodejs#43861

Reason for using build subsystem -
Shims will be just copied in stage_package label of vcbuild.bat

Fixes: nodejs#43861
hrishikesh-kadam added a commit to hrishikesh-kadam/node that referenced this issue Jul 22, 2022
This issue has been described in -
nodejs#43861

Reason for using build subsystem -
Shims will be just copied in the stage_package label of vcbuild.bat

Fixes: nodejs#43861
hrishikesh-kadam added a commit to hrishikesh-kadam/node that referenced this issue Jul 22, 2022
This issue has been described in -
nodejs#43861

Reason for using build subsystem -
Shims will be just copied in the stage_package label of vcbuild.bat

Fixes: nodejs#43861
hrishikesh-kadam added a commit to hrishikesh-kadam/node that referenced this issue Jul 22, 2022
This issue has been described in -
nodejs#43861

Reason for using build subsystem -
Shims will be just copied in the stage_package label of vcbuild.bat

Fixes: nodejs#43861
hrishikesh-kadam added a commit to hrishikesh-kadam/node that referenced this issue Jul 23, 2022
This issue has been described in -
nodejs#43861

Reason for using build subsystem -
Shims will be just copied in the stage_package label of vcbuild.bat

Fixes: nodejs#43861
@targos targos moved this to Pending Triage in Node.js feature requests Oct 22, 2022
@github-actions
Copy link
Contributor

There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment.

For more information on how the project manages feature requests, please consult the feature request management document.

@github-actions github-actions bot added the stale label Jan 14, 2023
@github-actions
Copy link
Contributor

There has been no activity on this feature request and it is being closed. If you feel closing this issue is not the right thing to do, please leave a comment.

For more information on how the project manages feature requests, please consult the feature request management document.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 13, 2023
@targos targos moved this from Pending Triage to Stale in Node.js feature requests Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issues that request new features to be added to Node.js. stale windows Issues and PRs related to the Windows platform.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants