Nest.js CLI not working

I can't get nestjs to work. It can't find the command
$ pnpx nest generate module auth
 ERR_PNPM_DLX_NO_BIN  No binaries found in nest
$ nest generate module auth
Command 'nest' not found, did you mean:
$ pnpx nest generate module auth
 ERR_PNPM_DLX_NO_BIN  No binaries found in nest
$ nest generate module auth
Command 'nest' not found, did you mean:
but it should be installed, it's in the Package.json
"devDependencies": {
"@nestjs/cli": "^10.0.0",
"@nestjs/schematics": "^10.0.0",
"@nestjs/testing": "^10.0.0",
"@types/express": "^5.0.0",
"@types/jest": "^29.5.2",
"@types/node": "^20.3.1",
"devDependencies": {
"@nestjs/cli": "^10.0.0",
"@nestjs/schematics": "^10.0.0",
"@nestjs/testing": "^10.0.0",
"@types/express": "^5.0.0",
"@types/jest": "^29.5.2",
"@types/node": "^20.3.1",
And pnpm says everything is up to date
$ node -v
v22.13.1
$ pnpm -v
10.2.1
$ pnpm i
Lockfile is up to date, resolution step is skipped
Already up to date
Done in 2.7s
$
$ node -v
v22.13.1
$ pnpm -v
10.2.1
$ pnpm i
Lockfile is up to date, resolution step is skipped
Already up to date
Done in 2.7s
$
Solution:
Solved it's pnpm nest ... instead of pnpx nest ...
Jump to solution
4 Replies
choco
choco2mo ago
have you download nest?
Solution
Bored Student
Bored Student2mo ago
Solved it's pnpm nest ... instead of pnpx nest ...
Bored Student
Bored StudentOP2mo ago
see the post, it's in Package.json and (p)npm install is up to date, so yes
caleb
caleb2mo ago
pnpm vs pnpx is actually frustrating sometimes. i also have better luck using pnpm dlx instead of pnpx

Did you find this page helpful?