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

create-next-app always uses yarn if it is installed #11628

Closed
tsriram opened this issue Apr 3, 2020 · 4 comments
Closed

create-next-app always uses yarn if it is installed #11628

tsriram opened this issue Apr 3, 2020 · 4 comments

Comments

@tsriram
Copy link
Contributor

tsriram commented Apr 3, 2020

Feature request

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

I have both npm and yarn installed in my laptop. When I create a new app using npm init next-app (or npx create-next-app), Next always uses yarn as the package manager. This is because it just checks if yarns is installed and decides to use it.

Describe the solution you'd like

Ideally, I'd like this command to check if the command is run using npm or yarn and use the same as package manager for the new app. I'd suggest to use is-npm package (or just copy those few lines 😛, if we don't want to add a dependency) and check if code is run using npm or yarn. If for any reason this module isn't able to determine the used package manager, we can use the current logic as a fallback mechanism.

I'm happy to submit a PR is this makes sense.

@timneutkens
Copy link
Member

timneutkens commented Apr 3, 2020

Hey! this is a duplicate of #10647

Feel free to add checking for it similar to https://github.com/sindresorhus/is-npm/blob/master/index.js. I'd like to avoid adding additional deps

@tsriram
Copy link
Contributor Author

tsriram commented Apr 5, 2020

Hi @timneutkens! I've made the changes locally but couldn't figure out how to test it. Would be great if you could share a quick note on how to run/test this locally. I'll add it to the README.md or CONTRIBUTING.md for future contributors.

@timneutkens
Copy link
Member

Tbh I'm not sure how to test this behavior correctly without fully running npm or yarn. Let's open a PR first and figure out how to test it later 👍

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants