question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Mix between Yarn and npm

See original GitHub issue

I just completed the tutorial and enjoyed learning about storybook.

However I noticed a mix of npm and yarn commands throughout the tutorial. Would you be interested in a PR consolidating the commands to use either npm or yarn throughout for consistency? And if so, which?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:17 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
tmeasdaycommented, Oct 6, 2019

Thanks for the detailed investigation @jonniebigodes.

My only remaining concern is inexperienced users who happen to have both yarn and npm installed (i.e. they’ve installed yarn at some stage for whatever reason, but aren’t experienced enough to mentally translate between npm and yarn commands).

The issue for such users is that create-react-app will default to yarn but all subsequent commands will use npm. However, we can fix that by changing the first call to:

npx create-react-app taskbox --use-npm

I checked and if you do that: a) CRA uses npm and creates a package-lock.json b) then, sb init also uses npm.

So my proposal would be

a) add the --use-npm flag to the first command b) add a note at that point saying “if you want to use yarn, drop the --use-npm and replace all npm commands with the equivalent yarn commands” c) change all calls to use npm.

Sound good everyone?

1reaction
jonniebigodescommented, Oct 7, 2019

@tmeasday i fully understand your reasoning, i was only focusing on experienced users and new users relative to the ecosystem. And wow i didn’t know that, the flag option, wow someone learned something new today(pardon the bad pun). And your proposal looks like the perfect fit for each case. I’m up for it as it will streamline the whole documentation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is there any harm in using NPM and Yarn in the same project?
So, even if we say it's a rare case that it won't cause harm. Mixing npm and yarn should be avoided. Share.
Read more >
Migrating from npm - Yarn
Migrating from npm should be a fairly easy process for most users. Yarn can consume the same package.json format as npm, and can...
Read more >
Project with mixed NPM and YARN use - DEV Community ‍ ‍
I contribute to a project where users use both NPM, and YARN. NPM generates package-lock. json, and yarn generates yarn-lock.
Read more >
I have both yarn and npm installed, and they're causing me ...
Yarn and npm are interchangeable. As long as you use the same one each time, there is no difference between them. They have...
Read more >
Yarn vs npm: Everything You Need to Know - SitePoint
Yarn stands for Yet Another Resource Negotiator. The Yarn package manager is an alternative to npm, released by Facebook in October 2016. The ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found