Nest CLI is a command line interface for creating the following things

  • Install NestJS
  • Uninstall NestJS CLI
  • upgrade Nest CLI

How to install nestJS Cli command line

First, Check whether the nest is installed or not using the version option

If it gives ‘nest’ is not recognized as an internal or external command error.

A:\work>nest --version
'nest' is not recognized as an internal or external command,
operable program or batch file.

Install nestcl globally @nestjs/cli is a package for nestjs that provides nest command. Install globally using the -g option

A:\work>npm install -g @nestjs/cli

added 254 packages, and audited 255 packages in 2m

41 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

Now, Let’s run and check the nest CLI version using --version option

A:\work>nest --version
9.1.4

How to uninstall nestjs cli

npm uninstall command remove nestjs/CLI globally and the nest command does not work

A:\work>npm uninstall -g @nestjs/cli

removed 254 packages, and audited 1 package in 59s

found 0 vulnerabilities

How to update or upgrade nestjs cli

If you installed with an older version already, and you want to upgrade the nest CLI command

if you want to install the latest version use the below command

npm install -g @nestjs/[email protected]