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?2 Replies
And, in the second case, Deno suggests me running
deno install --frozen=false
, but this does nothing.
The only fix is to remove "frozen": true
from the root deno.jsonc
and let Deno update the lockfile.Setting
nodeModulesDir: "manual"
in deno.json
should help