Skip to main content
On this page

The deno link command points your project at a local copy of a JSR package so you can develop against it in place of the published version. It is the command-line equivalent of editing the links array in deno.json by hand, and mirrors the workflow of npm link or bun link.

Linking a package Jump to heading

Pass the path to a local package directory:

›_
deno link ../my-local-pkg

The target must be a directory containing a deno.json or package.json with a name field, so Deno knows which package it stands in for. Deno appends the relative path to the links array in the nearest deno.json (creating the array if it does not exist) and then installs dependencies. The linked package is importable by its bare name, just like a workspace member, so no imports entry is added.

Linking the same path again has no additional effect. You can link several packages in one command:

›_
deno link ../pkg-a ../pkg-b

Use deno unlink to stop using the local copy:

›_
deno unlink ../my-local-pkg
Command line usage:
link

Link a local JSR package into the current project for development

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.

Last updated on

Did you find what you needed?

Edit this page
Privacy policy