Do you have a strong reason to use NPM or Yarn (or something else)?
Pacharapol Withayasakpunt
Posted on March 13, 2020
For some differences I have found,
Pro-Yarn
- Work better with Nuxt TypeScript -- Not sure if this is the right issue.
- "resolutions" -- https://stackoverflow.com/questions/52416312/npm-equivalent-of-yarn-resolutions
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 invisibleyarn 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
}
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
?
💖 💪 🙅 🚩
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.