Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nest Command not found

I followed the documentation to create my first NestJS project.

Installing the Nest CLI with the command npm i -g @nestjs/cli was successful.

The output was:

+ @nestjs/[email protected]
updated 1 package in 11.326s

However, when I try to scaffold a project with the Nest CLI:

nest new project-name

I get the following error:

zsh: command not found: nest

Some details about my environment:

  • OSX
  • iTerm
  • npm version 6.5.0
like image 391
Joël Sonderegger Avatar asked Apr 23 '19 06:04

Joël Sonderegger


People also ask

What is NEST command?

The Nest CLI is a command-line interface tool that helps you to initialize, develop, and maintain your Nest applications. It assists in multiple ways, including scaffolding the project, serving it in development mode, and building and bundling the application for production distribution.

How do I update NestJS?

First, we install two packages @nestjs/cli and npm-check-updates globally or as so-called devDependency. In this article, we go for the global approach. We need npm-check-updates because the NestJS CLI doesn't cover every single package from NestJS.

What is in NestJS?

NestJS is a framework for building efficient and scalable Node. js server-side applications built with and fully supporting TypeScript. It uses robust HTTP Server frameworks like Express or Fastify. Nest provides a level of abstraction above the common Node.

What does Nest build do?

nest build is a wrapper on top of the standard tsc compiler (for standard projects) or the webpack compiler (for monorepos). It does not add any other compilation features or steps except for handling tsconfig-paths out of the box.


1 Answers

Use npx @nestjs/cli instead of nest

e.g. npx @nestjs/cli g controller pages

like image 161
Amarjeet Singh Rai Avatar answered Oct 19 '22 15:10

Amarjeet Singh Rai