Do you have a strong reason to use NPM or Yarn (or something else)?

patarapolw

Pacharapol Withayasakpunt

Posted on March 13, 2020

Do you have a strong reason to use NPM or Yarn (or something else)?

For some differences I have found,

Pro-Yarn

Pro-NPM

  • Work better with eslint --init -- Not sure if this is the right issue.
  • npm install ../package uses symlink instead of copy. -- This is the case for me. I don't want to use the invisible yarn link

I don't much about something-else, like pnpm...

Anyways, if you need to enforce use Yarn only, there is has-yarn-cli, and I have cloned it for NPM -- is-npm-cli.

Put this in package.json

{
  "preinstall": "has-yarn",
  // Or, "preinstall": "if !(test -x has-yarn); then has-yarn; fi",
  // If you want to prevent running this on the remote server
}
Enter fullscreen mode Exit fullscreen mode

Of course, the way without using any packages is

I want to force using yarn install instead of npm install. I want to raise error in npm install. What should I do in package.json?

💖 💪 🙅 🚩
patarapolw
Pacharapol Withayasakpunt

Posted on March 13, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related