Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--skip-install should not ask for the package manager #1936

Closed
1 task done
aminnairi opened this issue Feb 15, 2023 · 4 comments
Closed
1 task done

--skip-install should not ask for the package manager #1936

aminnairi opened this issue Feb 15, 2023 · 4 comments
Labels

Comments

@aminnairi
Copy link

aminnairi commented Feb 15, 2023

Is there an existing issue that is already proposing this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe it

Currently, when generating a project using @nestjs/cli with the option --skip-install, the installation still asks for a package manager to choose even though no installation is made.

I would rather expect the installation to not ask for any package manager if I decide to skip the installation of dependencies when scaffolding a new project.

Describe the solution you'd like

When scaffolding a new Nest.js project using the @nestjs/cli package, the --skip-install option should prevent the installation from asking for choosing a package manager.

Teachability, documentation, adoption, migration strategy

Users would be able to run the following command

npx @nestjs/cli new project --skip-install

And get the expected behavior, which would be not to ask for a package manager.

What is the motivation / use case for changing the behavior?

The --skip-install option is not intuitive in its behavior, and this would help beginners have a more obvious understanding of the cli and also give the I don't know the cli but I'm able to get a good grasp at it feeling without inconsistencies.

@micalevisk
Copy link
Member

If you want to pass flags when using npx, you need to use the -- delimiter like this:

npx @nestjs/cli new foo -- --skip-install

Otherwise npx will treat that option as it was for npx, not for @nestjs/cli

That isn't related with nestjs cli.

@aminnairi
Copy link
Author

Have you tried this command? It seems like it does not solve the above issue, I'm still getting the prompt telling me to choose a package manager even though I copied your command in my shell (Bash).

Also woth mentionning that it does work if I specify the package manager as follow.

npx @nestjs/cli new app --skip-install --package-manager npm

But this should not be needed when running with --skip-install as per the above explanation.

@micalevisk
Copy link
Member

micalevisk commented Feb 15, 2023

oh, got it now, my bad. But we can't change that.

Even tho no installing will be made, the CLI still need to prompt you that info because the generated README.md file depends on it. You can check it out by selecting yarn and then cat app/README.md

To recap:

  • nest new app --skip-install works as expected. It should ask you for the package manager
  • npx @nestjs/cli new app --skip-install works as expected (no need to use the -- delimiter)
  • there is a WIP PR feat(new): support to skip install #1458 to allow us skipping the installation when that --skip-install is not supplied

@aminnairi
Copy link
Author

I see, that makes sense if the documentation needs it. I'll check out the PR you linked. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants