new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Deno · Reference · all subjects

cli commands/install

19 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

deno install - install all dependencies

The command `deno install` with no arguments installs all dependencies defined in `deno.json` and/or `package.json`. The dependencies are installed in the global cache. If the project has a `package.json` file, a local `node_modules` directory is also set up.

deno install PACKAGES - install specific packages

The command `deno install [PACKAGES]` installs particular packages and adds them to `deno.json` or `package.json`. Example: `deno install jsr:@std/testing npm:express`. Starting in Deno 2.8, unprefixed package names are treated as npm packages by default, so `deno install express` is equivalent to `deno install npm:express`. JSR packages still require the `jsr:` prefix.

deno install --os and --arch flags

Starting in Deno 2.8, `deno install` accepts `--os` and `--arch` flags to install npm packages targeting a different platform than the current one. These flags accept Node.js-compatible values, the same strings that `process.platform` and `process.arch` produce. Examples: `deno install --os linux --arch arm64`, `deno install --os win32 --arch x64`, `deno install --arch x64`. The `--os` and `--arch` flags are local-install-only and conflict with `--global`.

deno install --package-json flag

Starting in Deno 2.8, the `--package-json` flag forces dependencies to be written to `package.json`, regardless of any nearby `deno.json`. If no `package.json` exists, one is created. JSR packages added with `--package-json` are written in their npm-compatible form (`npm:@jsr/...`). This flag also works on `deno add`, `deno remove`, and `deno uninstall`. To make this behavior the default, set `"preferPackageJson": true` in `deno.json`.

deno install --entrypoint or -e flag

The `deno install --entrypoint [FILES]` (or `-e`) command installs all dependencies that are used in the provided files and their dependencies. This is useful for caching all dependencies before deploying a project when using `jsr:`, `npm:`, `http:` or `https:` specifiers. To set up a local `node_modules` directory, pass the `--node-modules-dir=auto` flag.

deno install --global or -g flag - install as binary

The `deno install --global [PACKAGE_OR_URL]` (or `-g`) command installs the provided package or script as a globally available binary on the system. It creates an executable shell script which invokes Deno using specified CLI flags and main module, placed in the installation root.

deno install --global --name or -n flag

Use `-n` or `--name` with `deno install --global` to change the executable name. Example: `deno install -g -n serve jsr:@std/http/file-server`. If not specified, the executable name is inferred by attempting to take the file stem of the URL path, or if the stem is generic (main, mod, index, or cli) and the path has no parent, the file name of the parent path is used. If the resulting name has an '@...' suffix, it is stripped.

deno install --global --root flag

Use `--root` with `deno install --global` to change the installation root. Example: `deno install -g --root /usr/local/bin jsr:@std/http/file-server`. The installation root is determined in order of precedence: `--root` option, `DENO_INSTALL_ROOT` environment variable, or `$HOME/.deno`. Executables are placed in the `bin` subdirectory of the installation root, unless the root path already ends with `bin`. The resulting directory must be added to PATH manually if required.

deno install --global with permission flags

When using `deno install --global`, you must specify permissions that will be used to run the script at installation time. Permissions can be passed before the script URL. Additional arguments can be passed after `--`. Example: `deno install -g -N -R jsr:@std/http/file-server -- -p 8080` creates an executable called `file_server` that runs with network and read permissions and binds to port 8080.

deno install --global --compile flag

The `deno install --global --compile [PACKAGE_OR_URL]` command compiles a package or script into a standalone, self-contained binary. The resulting executable can be distributed and run without requiring Deno to be installed on the target system. Example: `deno install --global --compile -A npm:@anthropic-ai/claude-code`.

deno install --prod flag

The `deno install --prod` command installs only production dependencies, skipping `devDependencies` from `package.json`. This is useful when deploying an application where development dependencies are not needed. The `--prod` flag conflicts with `--global` and `--dev`. In CI environments, prefer `deno ci --prod`, which also enforces a frozen lockfile and removes pre-existing `node_modules` before installing.

deno install --prod --skip-types flag

When combined with `--prod`, the `--skip-types` flag additionally skips `@types/*` packages from both `package.json` dependencies and `deno.json` imports. Example: `deno install --prod --skip-types`. The flag identifies type packages by checking if the package name starts with `@types/`, which may not cover all type-only packages.

deno install --prod --entrypoint combination

When `--prod` is combined with `--entrypoint`, the module graph is built as "code only", which excludes type-only dependencies. Example: `deno install --prod --entrypoint main.ts`. This provides the most precise production install — only dependencies that are actually imported at runtime by the specified entrypoint (and its transitive imports) are installed.

deno install --allow-scripts flag for lifecycle scripts

The `--allow-scripts=<packages>` flag allows npm packages to run their lifecycle scripts (such as `preinstall` or `postinstall`) during installation. Unlike npm, Deno does not run these scripts by default due to security concerns. Example: `deno install --allow-scripts=npm:sqlite3` installs all dependencies and allows the `npm:sqlite3` package to run its lifecycle scripts.

deno install --quiet flag

The `--quiet` flag suppresses diagnostic output when installing dependencies. It hides progress indicators, download information, and success messages. Example: `deno install --quiet jsr:@std/http/file-server`. This is useful for scripting environments or cleaner output in CI pipelines.

deno add command - alias for deno install PACKAGES

`deno add` is an alias to `deno install [PACKAGES]` and can be used interchangeably to install particular packages.

deno uninstall command

The `deno uninstall` command uninstalls dependencies or binary scripts. Examples: `deno uninstall express` removes a dependency, and `deno uninstall -g file-server` removes a globally installed binary.

import.meta.main idiom for executable scripts

When creating an executable script with `deno install --global`, use the `import.meta.main` idiom to specify the entry point. Example: `if (import.meta.main) { myAwesomeCli(); }` ensures the code only runs when the script is executed directly, not when imported as a module.

deno cache merged into deno install

The deno cache command has been merged into the deno install command. Use deno install --entrypoint <file> instead of deno cache <file>.

Give your agent this brain