The correct syntax to install a package globally with npm is npm install -g package-name. Option A uses this syntax correctly for the NestJS CLI package @nestjs/cli.
nest --version in the terminal?--version flag usually shows version info for CLI tools.Running nest --version after a successful global install displays the version of the NestJS CLI installed. It does not create projects or open docs.
npm install -g @nestjs/cli, but running nest gives 'command not found'. What is the most likely cause?If the global npm bin folder is not in your PATH, the shell cannot find the nest command. Restarting or linking is not required, and the package is actively maintained.
nest command after each install type.Global installation makes the CLI command available in any terminal location. Local installation installs it only inside the project folder, so you must run it via npx nest or scripts.
nest new my-app in a terminal with NestJS CLI installed globally?nest new command scaffolds a new project folder.Running nest new my-app creates a new folder named 'my-app' with starter files and asks which package manager to use. It does not show errors or open websites.