Skip to main content
On this page

The deno unlink command removes a local package link created with deno link, so imports resolve to the published registry version again. It edits the links array in the nearest deno.json for you.

You can remove an entry by its path or by the linked package's JSR name:

›_
# By the path you linked
deno unlink ../my-local-pkg

# By the package's JSR name
deno unlink @scope/name

Path arguments resolve relative to the current working directory, the same way deno link resolves them, so deno unlink ../pkg matches an entry created by deno link ../pkg from the same directory. When the links array becomes empty it is removed entirely.

If no argument matches a linked entry, deno unlink exits with a non-zero status rather than reporting success, so a mistyped path or name is detectable in scripts and CI. It never creates a deno.json: if there is none, there are no linked packages to remove.

Command line usage:
unlink

Remove a linked local package from the current project

Options Jump to heading

--frozen-lockfile
Jump to heading

Error out if lockfile is out of date.

Check the specified lock file. (If value is not provided, defaults to "./deno.lock").

--lockfile-only
Jump to heading

Install only updating the lockfile.

Disable auto discovery of the lock file.

Did you find what you needed?

Edit this page
Privacy policy