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
nodejs not working, exec format error #8151
Comments
|
@wangqr what is the output of This is a screenshot of |
|
It's zsh 5.8.1. Running under bash or strace gives save result though. |
|
Some more information:
|
|
The same problem on Debian: When run: libc6 is v2.33-7. WSL 1: |
|
As in #5875 following succeeds: |
|
Similar symptoms in #5154 |
|
the same error: #8219 |
|
Had the same issues and upgrading to WSL 2 worked for me Use from I did follow https://docs.microsoft.com/en-us/windows/wsl/install-manual#step-3---enable-virtual-machine-feature (and step 4) but node is working for me now. This is with Ubuntu 22.04 |
|
Any progress? I upgraded to 21H2: but still happens: |
|
As a workaround I updated #!/lib64/ld-linux-x86-64.so.2 /usr/bin/node
//#!/usr/bin/env node
require('../lib/cli.js')(process) |
|
It is possible to make a workaround for sudo mv /usr/bin/node /usr/bin/node-orig
printf '#!/bin/sh\nexec /lib64/ld-linux-x86-64.so.2 /usr/bin/node-orig "$@"' | sudo tee /usr/bin/node
sudo chmod a+x /usr/bin/nodeMy previous fix for |
|
@gavenkoa my general fix is to run
The script is here: https://github.com/ysoftwareab/yplatform/blob/master/bin/wsl-fix-exec-format-error Based on https://gist.github.com/the-moog/179753aacc52b262d1068878d520e9c9 by @the-moog @wangqr Running realpath is needed because sometimes (eg homebrew) node in your $PATH is a symlink PS: I have found that I need to patch gzip as well, not just node, so a generic patch script is really good to have |
|
@andreineculau I understand the solution, the initial analysis was done by #8219 (comment) stating that it is a bug in
|
@gavenkoa This method can be problematic for modules that assume argv[0] be node itself when running node. For example, |
|
@wangqr wrote:
I had the same issue. I think you altered
If |
|
I got the same problem. after I fixed this problem by using nodejs package |
|
i got same problem. i fix this problem using this command, hope help other |
|
Update to WSL v2 as @srogerf suggested - worked for me. |
|
@qchencc 's solution worked for me on WSL1 + Ubuntu 18.04 + Windows 11 22H2, but required switching to Node v16: |
|
There were a similar issue with Qt. It was fixable using a strip command for removing |
|
root@GM00234:/mnt/c/api-service-js# sudo apt-get install -y nodejs Any solution for this? |
Otherwise I get the error message as described here: microsoft/WSL#8151
|
I also encountered the same problem and solved it by:
|

Version
Microsoft Windows [Version 10.0.19044.1586]
WSL Version
Kernel Version
4.4.0-19041-Microsoft
Distro Version
Arch
Other Software
No response
Repro Steps
Install nodejs from Archlinux repo with
pacman -S nodejs, and runnodeExpected Behavior
nodejs starts
Actual Behavior
nodejs does not start. exec format error.
Diagnostic Logs
nodejs can start if we manually invoke ld-linux, although it is already the interpreter in the ELF.
The text was updated successfully, but these errors were encountered: