denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
98.03k stars 5.39k forks source link

Error during Deno 2.0 installation on WSL: .deno/enveval: No such file or directory #26481

Open DiegoT4l opened 1 month ago

DiegoT4l commented 1 month ago

Version: Deno 2.x.x

When installing Deno 2.0 in a WSL (Windows Subsystem for Linux) environment, the following error appears in the terminal upon opening a new Bash session:

-bash: /home/diegot4l/.deno/enveval: No such file or directory

After investigating, I found a problematic line in the ~/.bashrc file that was automatically added during the Deno installation:

. "/home/diegot4l/.deno/env"eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"

The issue is that the line is malformed. It should be separated into two distinct commands:

. "/home/diegot4l/.deno/env"
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"

Steps to reproduce the issue:

  1. Install Deno 2.0 on a WSL environment using the official installation script (curl -fsSL https://deno.land/install.sh | sh)
  2. Open a new terminal session in WSL.
  3. The aforementioned error appears in the terminal.

Expected behavior:

The installation should correctly configure the ~/.bashrc file without errors, allowing the use of Deno without additional issues.

Development environment:

Possible solution:

Update the installation script to ensure the commands are correctly written to the ~/.bashrc file, avoiding the error.

DiegoT4l commented 1 month ago

image

xdvarpunen commented 1 week ago

Hi,

My WSL Ubuntu

Distributor ID: Ubuntu
Description:    Ubuntu 24.04.1 LTS
Release:        24.04
Codename:       noble

My Deno

deno 2.0.6 (stable, release, x86_64-unknown-linux-gnu)
v8 12.9.202.13-rusty
typescript 5.6.2

I did following to make Deno installation work:

  1. Go to WSL wsl
  2. Change directory to root in WSL cd ~
  3. Run installation script provided in documentation curl -fsSL https://deno.land/install.sh | sh
  4. Get error saying Error: either unzip or 7z is required to install Deno (see: https://github.com/denoland/deno_install#either-unzip-or-7z-is-required ). 4.1 Installation complained about unzip/7zip missing so installed it 4.2 bash sudo apt-get update sudo apt-get install unzip
  5. Rerun installation script provided in documentation curl -fsSL https://deno.land/install.sh | sh
  6. Exit WSL exit
  7. Go to WSL wsl
  8. deno command should be available

Hopefully helps. HTH :)