DEV Community

Pacharapol Withayasakpunt
Pacharapol Withayasakpunt

Posted on

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?

Top comments (2)

 
patarapolw profile image
Pacharapol Withayasakpunt • Edited

It seems not to usually be the case, although it is sometimes possible to use simply xcode-select --install.

I once complain about this -- Xcode app size is too large. Is there a minimal version to use for simply C++ and C# (Qt creator, Visual Studio)?

From this perspective, a real Linux seems to be the best and least restrictive. Not sure about WSL.

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt • Edited

Not as much as having to install XCode on macOS, in order to be able to compile C plugins (for Node.js).