jetify-com / devbox

Instant, easy, and predictable development environments
https://www.jetify.com/devbox/
Apache License 2.0
8.2k stars 192 forks source link

Exec format error #1969

Closed powerAn2020 closed 4 months ago

powerAn2020 commented 4 months ago

What happened?

image

Steps to reproduce

  1. OS: WSL1 Ubuntu 22.04.4 LTS
  2. devbox add nodejs
  3. devbox shell
  4. node

Command

No response

devbox.json

{
  "$schema":  "https://raw.githubusercontent.com/jetpack-io/devbox/0.10.3/.schema/devbox.schema.json",
  "packages": ["nodejs@21.7.1"],
  "shell": {
    "init_hook": [
      "echo 'Welcome to devbox!' > /dev/null"
    ],
    "scripts": {
      "test": [
        "echo \"Error: no test specified\" && exit 1"
      ]
    }
  }
}

Devbox version

0.10.3

Nix version

No response

What system does this bug occur on?

Linux (x86-64)

Debug logs

No response

Lagoja commented 4 months ago

I think this is a known issue with WSL 1 + NodeJS, and not with Devbox. https://stackoverflow.com/questions/73616907/how-to-use-node-in-wsl-zsh-exec-format-error-node

We currently only recommend and support WSL 2. Nix does not work out of the box with WSL 1, and requires a few workarounds to get things working correctly: https://nixos.wiki/wiki/Nix_Installation_Guide#Windows_Subsystem_for_Linux_.28WSL.29

powerAn2020 commented 4 months ago

Thank you, I will switch to wsl2.