Install packages from the npm registry into node_modules.

Synopsis

ipk install [<pkg>[@<spec>] ...]

ipk i [<pkg>[@<spec>] ...]

ipk add [<pkg>[@<spec>] ...]

Description

Fetches packages from the real npm registry and extracts them into <cwd>/node_modules, recording named installs in <cwd>/package.json under dependencies (existing fields are preserved). Idempotent — re-installing an already-satisfied package is a clean no-op. This is how .jsh scripts and node -e code get access to real npm packages via require() (see man jsh, man node): install first with ipk, then require() resolves the package from the nearest installed node_modules.

add is accepted as an alias of install/i even though it is not listed by ipk --help — all three forms behave identically.

No-arg form

ipk install Read cwd package.json and install every entry from dependencies AND devDependencies.

Spec forms

<pkg> Install the latest published version.

<pkg>@x.y.z Install an exact version.

<pkg>@^x.y.z Install the highest version matching the caret range.

<pkg>@~x.y.z Install the highest version matching the tilde range.

<pkg>@latest Install the version pointed at by the latest dist-tag.

<pkg>@* Install the latest published version (wildcard).

@scope/name Scoped packages install under node_modules/@scope/name.

Options

-h, --help Show this help message.

Examples

$ ipk add mri

Install a small argument-parsing package for use from a .jsh script.

$ ipk add esbuild-wasm typescript

Install the backing packages that the esbuild and tsc wrapper commands need — both are inert until their package is present in node_modules.

$ ipk add @biomejs/wasm-web@2.5.1 @biomejs/js-api@6.0.0 esbuild-wasm@0.28.1

Install the three packages the biome wrapper needs together (it also needs esbuild-wasm to load the wasm-web ESM glue).

$ ipk install

Re-install everything already recorded in the current directory's package.json.

Notes

Every install is scoped to the current working directory's node_modules — there is no global install location. Move or copy a .jsh script to a directory without a matching node_modules and its require('some-pkg') calls will fail; either re-run ipk add next to the script, or bundle it into a single self-contained file first with esbuild --bundle (see man esbuild) so it no longer needs a local node_modules at run time.

npm and i are aliases for this same command; npx is an alias for ipx.

See Also

ipx, esbuild, tsc, biome, jsh, node, commands