binary-installer/README.md
This project is responible for creating the built binaries that auto-update framework builds, as well as install.sh script that is used in the curl command we provide for installation.
To use the install script that is currently deployed, you would run the following curl command from your command prompt,
curl -o- -L https://install.serverless.com | bash
This installs the most recent launcher binary. The framework itself is downloaded the first time you run serverless, so expect that initial invocation to fetch the latest release.
By default the serverless command will check for a new update every 24 hours.
If however you want to force a download of a new version you can set the environment variable SERVERLESS_FRAMEWORK_FORCE_UPDATE=true and then anytime you run serverless it will check if a new version is available and download it.
For environments that use private CAs or TLS-intercepting proxies, the installer and framework downloads can trust additional certificate authorities via the following environment variables:
NODE_EXTRA_CA_CERTS: Path to a PEM file containing one or more root CAs.SSL_CERT_FILE: Path to a PEM file containing one or more root CAs.SSL_CERT_DIR: Path list (separated by your OS path list separator, e.g. : on Unix or ; on Windows) of directories containing PEM-encoded CA files.These certificates are added to the system trust store used by the installer’s HTTP client.
main.go):
SLS_DISABLE_EXTRA_CA_CERTS is set to a non-"false" value (see Custom CA Certificates section).~/.serverless/binaries exists.serverless update, downloads and swaps the installer binary in place.node_modules/serverless is present, defers execution to it for backwards compatibility.--config/-c flags or scans the CWD for supported filenames (serverless.*, serverless-compose.*, serverless.containers.*, serverless.ai.*).src/version.go):
frameworkVersion from the service config (supports YAML, JSON, and generic JS/TS via regex).frameworkVersion: canary or canary-<commit-short-sha>): fetches the latest/specified canary release metadata from the install host.~/.serverless/releases/<version> by downloading an archive and running npm install in the extracted package/ folder.node and npm exist and Node.js is >= 18.node <releasePath>/package/dist/sf-core.js with the original CLI arguments.~/.serverless/binaries/metadata.json
{ "version": string, "updateLastChecked": ISO8601 }updateLastChecked throttles how often the versions index is re-fetched. version is informational (printed on install) and not used for logic.~/.serverless/binaries/versions.json
supportedVersions, blockedVersions).~/.serverless/releases/<version>/
package/ and installed dependencies.package/dist/sf-core.js.https://install.serverless.com/versions.jsonmetadata.json.updateLastChecked.~/.serverless/binaries/versions.json. On errors, a present cache is used as a fallback.https://install.serverless-dev.com/releases.json (for latest canary). For pinned canary, the version is taken from config directly.https://install.serverless.com/archives/serverless-<version>.tgzhttps://install.serverless-dev.com/archives/<canary-version>.tgz (or canary-<x>.tgz for latest)metadata.json is updated.<install host>/installer-builds/serverless-<os>-<arch>serverless update.~/.serverless/releases/<version> directory is missing, orserverless update or SERVERLESS_FRAMEWORK_FORCE_UPDATE=true.SERVERLESS_FRAMEWORK_FORCE_UPDATE
SLS_DISABLE_EXTRA_CA_CERTS
NODE_EXTRA_CA_CERTS, SSL_CERT_FILE, SSL_CERT_DIR
CI
frameworkVersion is specified.npm must be available on PATH.https://install.serverless.com (stable releases and versions index)https://install.serverless-dev.com (canary channel)versions.json if present.npm install fails during release installation, combined output and exit code are surfaced to stderr and the process exits non-zero.frameworkVersion can be specified in YAML (serverless.yml), JSON (serverless.json), or inferred from JS/TS (serverless.js, serverless.ts, serverless.cjs). For JS/TS, a simple regex extracts frameworkVersion: 'x.y.z'.^4.0.0) are matched against the supported list from versions.json. Exact blocked versions are warned about but still honored if requested.frameworkVersion: canary opts into the canary channel; canary-<commit-short-sha> pins a canary build directly.