Nest-cli: Provide npx package

Created on 31 Jan 2019  路  5Comments  路  Source: nestjs/nest-cli

It would be nice to have an npx package so that nest can be installed with something like:
npx nest new project

For example, create-react-app can be installed with npx without needing to install the CLI package globally.

Most helpful comment

This is already possible npx -p @nestjs/cli nest new [project] is how I setup my project.

However it's fairly verbose and messy because you have to explicitly specify the -p @nestjs/cli.

Both yarn and npm actually support shortcuts for generating projects without needing to -g install a cli in order to do so.

If you create an official package named create-nest-project then each of the following commands will act as a shortcut to allow someone without @nestjs/cli installed globally to create a nest project in a single line.

  • yarn create nest-project
  • npm init nest-project
  • npx create-nest-project

All 5 comments

Sounds like a duplicate of #145?

This is already possible npx -p @nestjs/cli nest new [project] is how I setup my project.

However it's fairly verbose and messy because you have to explicitly specify the -p @nestjs/cli.

Both yarn and npm actually support shortcuts for generating projects without needing to -g install a cli in order to do so.

If you create an official package named create-nest-project then each of the following commands will act as a shortcut to allow someone without @nestjs/cli installed globally to create a nest project in a single line.

  • yarn create nest-project
  • npm init nest-project
  • npx create-nest-project

It appears that using a non-scoped create-nest-project may not be necessary.

npm init @nestjs will install @nestjs/create and run the binary.

So basically it would be good if we had a @nestjs/create package which just depends on @nestjs/cli and has a binary that executes nest new ... from there.

Sounds like a duplicate of #145?

@kamilmysliwiec Unlikely. The PR has been merged (6.6.0), but npx nest still doesn't work. See the 2 posts above.

I've just tested and npx @nestjs/cli new APP works fine.

Was this page helpful?
0 / 5 - 0 ratings