DEV Community

Discussion on: What is the difference between yarn and npm these days?

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt • Edited

I now prefer NPM, but NPM does sometimes have problem with installing from package-lock.json.

Some other still missing features of NPM include,

Luckily, I now know an easy way to npm-not-yarn and yarn-not-npm, with zero dependency.

echo 'engine-strict=true' >> .npmrc
// package.json

{
    "engines": {
      "node": "12.x",
      "npm": "6.x",
      "yarn": "please-use-npm"
    }
}

It is a best idea to pin dependencies and engines visibly for open source contributors, anyway.