NestJS 安装与初始化项目

NestJS Node.js About 1,386 words

安装命令行

-g:全局安装

npm i -g @nestjs/cli

初始化项目

nest new project-name

输出

$ nest new nestjs-demo
✨  We will scaffold your app in a few seconds..

✔ Which package manager would you ❤️  to use? npm
CREATE nestjs-demo/.prettierrc (56 bytes)
CREATE nestjs-demo/eslint.config.mjs (934 bytes)
CREATE nestjs-demo/nest-cli.json (179 bytes)
CREATE nestjs-demo/package.json (2053 bytes)
CREATE nestjs-demo/README.md (5126 bytes)
CREATE nestjs-demo/tsconfig.build.json (101 bytes)
CREATE nestjs-demo/tsconfig.json (702 bytes)
CREATE nestjs-demo/src/app.controller.ts (286 bytes)
CREATE nestjs-demo/src/app.module.ts (259 bytes)
CREATE nestjs-demo/src/app.service.ts (150 bytes)
CREATE nestjs-demo/src/main.ts (236 bytes)
CREATE nestjs-demo/src/app.controller.spec.ts (639 bytes)
CREATE nestjs-demo/test/jest-e2e.json (192 bytes)
CREATE nestjs-demo/test/app.e2e-spec.ts (694 bytes)

✔ Installation in progress... ☕

🚀  Successfully created project nestjs-demo
👉  Get started with the following commands:

$ cd nestjs-demo
$ npm run start


                          Thanks for installing Nest 🙏
                 Please consider donating to our open collective
                        to help us maintain this package.


               🍷  Donate: https://opencollective.com/nest

启动项目

默认监听3000端口。

npm run start

GitHub

https://github.com/nestjs/nest

官方文档

https://docs.nestjs.com

https://docs.nestjs.cn

Views: 9 · Posted: 2026-06-05

———         Thanks for Reading         ———

Give me a Star, Thanks:)

https://github.com/fendoudebb/LiteNote

扫描下方二维码关注公众号和小程序↓↓↓

扫描下方二维码关注公众号和小程序↓↓↓
Prev Post
Today In History
Browsing Refresh