-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Closed as not planned
Closed as not planned
Copy link
Labels
needs discussionthis topic needs further discussion to determine what action to takethis topic needs further discussion to determine what action to takenode compattriage required 👀Deno team needs to make a decision if this change is desiredDeno team needs to make a decision if this change is desired
Description
Just noticed that deno run downloads a lot of modules referencing an earlier iteration of the code when deno.json is present. When I delete the deno.json file it works as expected.
Steps to reproduce
- Create
deno.jsonwith{ "lock": true }as the content - Create `foo.ts with this content:
import "npm:htm";
import "npm:preact";
import "npm:preact-render-to-string";
console.log("foo");- Run
deno run -A foo.ts(adeno.lockshould be present now) - Delete all imports in
foo.ts - Run
deno run -Ar foo.ts-> Downloads all npm modules from the previous iteration
Tip: On macOS/Linux use deno run -Ar foo.ts &> foo.log to pipe the output to foo.log which highlights the problem more clearly.
It seems like it's not possible to remove an npm dependency once it was imported at some point in the project. Looking at the deno.lock file it seems to confirm that theory as it still contains all three npm imports.
Reactions are currently unavailable
Metadata
Metadata
Labels
needs discussionthis topic needs further discussion to determine what action to takethis topic needs further discussion to determine what action to takenode compattriage required 👀Deno team needs to make a decision if this change is desiredDeno team needs to make a decision if this change is desired