Package installer
StableInstall direct dependencies from package.json, with lockfile pins and integrity checks. Not an npm replacement.
amber install is Stable (G3) for the subset in docs/INSTALL_CONTRACT.md.
Usage
bash
amber install
amber install --frozen-lockfile
What it does
- Reads
dependenciesanddevDependenciesfrom./package.json. - Downloads tarballs from
https://registry.npmjs.orgintonode_modules. - When
./package-lock.jsonhas a top-leveldependenciesentry for a package, checks the version request, theresolvedURL, andintegrity. - Hashes every tarball before unpacking it (SRI
sha512,sha384,sha256, orsha1, else the SHA-1shasum). --frozen-lockfilefails if the lock is missing or a direct request does not match it, and never rewrites the lock.
Contracted failures print error: amber install: and exit non-zero.
What it does not do
amber install is not npm, yarn, or pnpm. These are outside the contract:
- Workspaces, lifecycle scripts (
postinstalland friends), and.binlinks. - Custom registries and
.npmrc. - Installing
peerDependencies. - The lockfile
packagesmap, nested lock entries,yarn.lock, andpnpm-lock.yaml. - Lock pins for transitive dependencies. Unlocked ranges follow registry order, not the highest matching semver.
optionalDependencies download errors do not fail the command.
Experimental package commands
amber add, amber remove, amber prune, amber upgrade, amber init, amber create, and amber x (also dlx and bunx) exist but are Experimental. They are outside the install contract.
bash
amber add lodash@4.17.21 # Experimental
amber x cowsay hello # Experimental