denoland / deno

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

unzip not found on PATH on Ubuntu 22.04 when using 'deno compile', although unzip has been installed and can be executed on command line #23988

Closed flo-jan closed 1 month ago

flo-jan commented 3 months ago

deno 1.43.6 (release, x86_64-unknown-linux-gnu) Ubuntu 22.04

When I give the command 'deno compile' it gives the error: "unzip was not found in your PATH, please install unzip".

But unzip is installed. I can use unzip commands in the same terminal as where I try to execute the deno compile command.

Could this be a bug?

jerome-benoit commented 3 months ago

Outputs of

echo $PATH
echo $SHELL
which unzip
flo-jan commented 3 months ago

output of echo $SHELL is '/bin/bash'

other outputs can be seen in screenshot: deno and unzip

littledivy commented 3 months ago

Maybe the temp directory Deno created got deleted before unzip was called. @flo-jan Do you have any background service that deletes /tmp/?

The error message can be improved.

flo-jan commented 3 months ago

Deno runs as Snap application.

There is a /tmp/snap-private-tmp/snap.deno/tmp/ folder. It is empty and remains empty after running deno compile, but I can see something happens with it, because the modified date of that folder updates each time I run deno compile.

flo-jan commented 3 months ago

I would be interested if someone is able to reproduce this issue

flo-jan commented 2 months ago

I tried another way of installing deno, not with Snap but with this command: curl -fsSL https://deno.land/x/install/install.sh | sudo DENO_INSTALL=/usr/local sh

I still encounter the same problem when trying to run deno compile but with a different error message:

Archive:  /tmp/.tmpPoaYid/denort.zip
  inflating: denort                  
error: Writing write

Caused by:
    No such file or directory (os error 2)

I checked the /tmp folder. I can create folders and files in it and they are not removed automatically.

I also tried another laptop with Ubuntu 22.04 installed and on that laptop deno compile works without problems.

jerome-benoit commented 2 months ago

Since an Ubuntu clean install of the same version does not trigger any issues, it looks more like an issue with the OS and/or the user env setup.

flo-jan commented 2 months ago

Deno.makeTempFile() works correctlty however, on the same computer

flo-jan commented 2 months ago

it creates files in the /tmp folder

flo-jan commented 2 months ago

It would be helpful if would know the exact location in deno's source code where this

Archive:  /tmp/.tmpPoaYid/denort.zip
  inflating: denort                  
error: Writing write

Caused by:
    No such file or directory (os error 2)

happens. Could someone point me to that?

sakars commented 2 months ago

I seem to be having a similar issue, unzip is located in PATH and at least the help page is displayed for it from the terminal, but deno compile fails. I will note that I am launching this from a VirtualBox VM