-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
npm init next-app creates a project that uses yarn #10647
Comments
Already answered as per #10642 (comment) This is expected behavior as you have yarn installed. |
How could you possibly think that running npm init would create a project
with yarn? This is absolutely not expected behavior for the end user. I've
noticed this happening in many Next.is issues. You come in and make some
short comment then close the ticket without any further investigation or
conversation.
This is at the very least a documentation issue. It is not obvious at all
that when you offer an npm option and a yarn option, that choosing the npm
option will lead to the project being created with yarn. Whether or not I
have yarn installed is completely irrelevant.
…On Sun, Feb 23, 2020 at 1:38 PM Tim Neutkens ***@***.***> wrote:
Closed #10647 <#10647>.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#10647>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMVRRISPQ52LIOT6VDFMMY3RELUFDANCNFSM4KZ36YKA>
.
|
@lfades let's update the docs to just mention |
I'm saying it's expected behavior and implemented this way by design, here's the |
Sorry, I guess we were misunderstanding each other, and that’s my fault. I
meant unexpected behavior from the user’s point of view.
I should have mentioned from the start that I felt this was a documentation
issue, not a code issue, though I do still feel it’s odd DX. Anyway, the
problem can definitely be solved by a short line in the docs. I was going
to add a PR myself, but I wasn’t sure how you all would want to phrase it,
or which method was preferred (—use-npm or npx).
…On Mon, Feb 24, 2020 at 8:54 AM Tim Neutkens ***@***.***> wrote:
How could you possibly think that running npm init would create a project
with yarn?
I'm saying it's expected behavior and implemented this way by design,
here's the yarn check:
https://github.com/zeit/next.js/blob/canary/packages/create-next-app/index.ts#L101
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#10647>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMVRRITSDCF2CH3E7NL252TREP3VDANCNFSM4KZ36YKA>
.
|
I also agree with @pjaws. Even if we have have yarn installed, create-next-app should have a switch to use npm instead of yarn if its detected. |
FYI: Both |
@tsriram did some investigation into how to detect npm here: #11628 (comment) Happy to take in a PR as mentioned in that issue 👍 |
This should be fixed in #11683. I guess this issue can be closed once the new version is published. |
@tsriram is there anyway to fix this in existing codebases? |
Just run into the same issue today and was surprised next install by using yarn instead of npm. Doc says:
So can you explain (or fix the documentation) because I'm really lost. |
Anyone who comes here, I don't think it's well documented but I found you can install with npm using the e.g.
Hope this helps 🙂 |
Related issue: #10647 (comment) Sometimes we have both Yarn and NPM installed and want to explicitly bootstrap an app with the CLI using NPM. Having this flag documented could help people understand the package manager behavior and select NPM if that's their preference.
FYI running |
This comment has been minimized.
This comment has been minimized.
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. |
Bug report
Describe the bug
Running
npm init next-app
creates a new Next.js project that uses Yarn, rather than npm. Given, the fact that I'm using npm to create the project, and the docs offer two options for getting started, one with npm and one with Yarn, this is completely unexpected behavior.To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
npm
optionnpm init next-app
Expected behavior
It should create a project that uses npm for package management.
Here ya go, Tim!
The text was updated successfully, but these errors were encountered: