i_use_arch_btwI
Denoβ€’5mo agoβ€’
3 replies
i_use_arch_btw

How to prevent Deno from automatic dependencies installation during `deno task`? Why does it happen?

Hey! I have a few problems with deps and
deno task
.

One is, I have my own
install
task that is running
deno install
with certain arguments (e.g.
--allow-scripts
,
--env-file
etc). However, if I run
deno task install
, it first installs the dependencies, before running my task. This is confusing and I don't know how to disable it.

Another is, Deno unexpectedly updates the lockfile when I don't ask it to. Here is a failing workflow: link. After installing packages with
deno install
(with frozen lockfile) in the workspace root, everything is fine. However, when running a task from a workspace member at
tests/node
(the command is
vitest run
), Deno errors me that the lockfile is out of date - for some reason, it wants to add another entry for
npm:vitest
.

So, first, I am curious why is it that Deno installs packages during
deno task
in the first place, and second, why this behaviour is inconsistent in the workspace?
Was this page helpful?