To improve dependency management, Deno 2.0 introduces: deno add
Subcommands for handling specifiers with subpaths. Also, if your project contains a package.json file, Deno prefers to add: npm:
Replaces dependencies in package.json. deno.json
Developers can add a “dev dependency” to their package.json using: --dev
Flags. Also with Deno 2.0, deno install
Now supporting --entrypoint
A flag to install all dependencies from a given module. And the new deno remove
Subcommands have been added to quickly remove some dependencies. Deno 2.0 ships with a more concise lock file format (v4) to minimize diffs when updating dependencies and ensure reproducible builds. Deno also improves error messaging to provide hints about common problems, such as malformed relative import paths or missing dependencies when using “bare specifiers.” DenoLand says these updates streamline the overall process of managing dependencies in Deno projects, making it more intuitive and more in line with modern development workflows.
The Deno permission system also gets some attention in Deno 2.0. In version 2.0, Deno permissions are now lacking Deno.errors.Notcapable
Instead of an error Deno.errors.PermissionDenied
Makes it easier to distinguish between OS-level errors and Deno errors. Permissions also check for: Deno.mainModule
The API for providing the full path to the main module has been relaxed so that the full path is no longer required. --allow-read
Permission. This also applies to: process.argv
API. You can now also grant permission to read and write files with commas in their file names.
Other new features and changes in Deno 2.0: