CLI Release: v21.0.0

May 6, 2025

21.0.0 (2025-05-06)

⚠ BREAKING CHANGES

remove support for deprecated netlify-lambda package (#7236)

The netlify-lambda NPM package was deprecated in Feb 2023. If you are one of the few using this, see the migration guide.

⚠ Potentially breaking changes

run build before deploy (#7195)

The deploy command now runs the site’s configured build command before deployment by default. Previously, this was achieved by passing the —build flag. In other words, —build is no longer needed.

To opt into the previous default behavior, users can now specify netlify deploy —no-build.

Why are we changing this?

This has long been one of the most common sources of confusion with the Netlify CLI. Developers expect a “deploy” command to deploy their project. We’re making this change to follow the Principle of Least Surprise and streamline the experience for new users.

Upgrading

👉🏼 (most common) Build and deploy

Remove the —build flag:

netlify deploy —build […] # before

netlify deploy […] # after

👉🏼 Separate build and deploy

Warning

Make sure your deploy command runs in your expected environment, e.g. if you were running FOO=bar netlify build && netlify deploy, make sure FOO is visible to the deploy command, which is now running the build: FOO=bar netlify deploy.

Collapse into one command, if you can:

netlify build && netlify deploy # before

netlify deploy # after

Otherwise, add the —no-build flag:

make spaghetti && netlify deploy # before

make spaghetti && netlify deploy —no-build # after

👉🏼 (rare) Deploy without build step

Add the —no-build flag:

netlify deploy […] # before (there was no --build here)

netlify deploy —no-build […]

polish and improve deploy command output (#7250) (795a451)

If you were automatically looking for specific strings in the netlify deploy output, your scripts may stop working. See the above PR for details.

Note that this is not recommended and such changes may not be considered breaking in the future. For stable output that conforms to semantic versioning, use netlify deploy —json.

Features

link out to relevant Netlify docs in command help output (#7254) (1978faf)

remove support for deprecated netlify-lambda package (#7236) (0d48c28)

run build before deploy (#7195) (8e95c58)

telemetry: send command opts and args (#7251) (9545bdc)

Bug Fixes

deploy: remove messages about future deprecated flag removals (#7252) (758fd88)

deps: update dependency @netlify/edge-functions to v2.12.0 (#7239) (5d70c98)

dev: polish and improve dev command output (#7249) (7a5b7c0)

fix framework server loading spinner (“Waiting for framework port”) (#7242) (841d782)

polish and improve deploy command output (#7250) (795a451)

polish and improve postinstall onboarding message (#7248) (d9523c7)