Registry / devops / create-base-nestjs

create-base-nestjs

JSON →
library1.1.6jsnpmunverified

A CLI tool (v1.1.6) to scaffold a production-ready NestJS 11 backend with JWT + OAuth2 authentication, Prisma ORM v7, PostgreSQL/SQLite support, and additional features like RBAC, avatar upload, email verification, Socket.IO, and event-driven architecture. It auto-generates .env with random JWT secrets, supports switching between SQLite and PostgreSQL, and provides an upgrade mechanism to keep existing projects in sync with the latest template. Release cadence is irregular; maintained on GitHub. Key differentiators include OAuth2 support (Google, Discord), upgrade utility, and configurable database selection at scaffold time.

npm install create-base-nestjs
INSTALL
IMPORT
SIG · CREATE-BASE-NESTJS
C
create-base-nestjs
devopsjavascriptv1.1.6
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

createBaseNestjs
npx create-base-nestjs <project-name>
npm install -g create-base-nestjs && create-base-nestjs
Tool is designed to be run via npx; global install is not recommended as it may cause version conflicts.

Scaffolds a new NestJS project named 'my-project' using defaults (SQLite, prompts skipped).

npx create-base-nestjs my-project --yes cd my-project npm run start:dev
Debug
Known issues
breakingBreaking changes detected during upgrade: files with similarity <60% will be overwritten without diff.
fix
Always commit or backup before running `npx create-base-nestjs --upgrade`. Review changes with `git diff` after upgrade.
affects: >=1.0
deprecatedThe --pg flag uses hardcoded PostgreSQL credentials (user: postgres, password: 123).
fix
Manually update .env after scaffolding to use secure credentials.
affects: >=1.0
gotchaOAuth2 secrets (Google, Discord) are not auto-generated; you must manually obtain and set them.
fix
After scaffolding, fill in GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, DISCORD_CLIENT_ID, DISCORD_CLIENT_SECRET in .env.
affects: >=1.0
gotchaThe upgrade process runs `npm install` and `npx prisma generate` automatically, which may break if dependencies are incompatible.
fix
Review dependency changes in package.json before upgrade; consider running in a test branch.
affects: >=1.0
breakingFile .base-nest-version is created on upgrade, but deleting it may cause subsequent upgrades to behave incorrectly.
fix
Do not manually delete .base-nest-version; if missing, recreate by running `npx create-base-nestjs --upgrade` again.
affects: >=1.0
Errors
Common errors & fixes
Error: Cannot find module '@nestjs/core'
Missing node_modules after scaffold (npm install not run automatically in all cases).
fix
Run `npm install` inside the scaffolded project directory before starting.
Prisma Migrate could not create the database. Error: Can't reach database server
PostgreSQL connection configured but server not running or credentials incorrect.
fix
Ensure PostgreSQL is running and credentials match .env. Run `npx prisma migrate dev` after fixing.
JWT_SECRET is not defined
.env file missing or not loaded; sometimes .env.example is copied but with placeholder values.
fix
Copy .env.example to .env and run `npx create-base-nestjs --jwt-secret` to generate secrets, or manually set JWT_SECRET and JWT_REFRESH_SECRET.
Error: listen EADDRINUSE :::3000
Another process is already using port 3000.
fix
Kill the process occupying port 3000 or change port in .env (APP_PORT).
Upgrade
Version history
1.1.6latest on npm
Audit
Dependencies
noderequiredRequires Node.js >= 18 as per engines field
Agent activity
4 hits · last 30 days
node
4
Resources
create-base-nestjs — npm install create-base-nestjs · libregistry