Yarn versus NPM

Over the last few days, I have had to use both Yarn and NPM to attempt to install two different programs for a couple of home networking experiments. The dependency packaging of Node projects leaves something to be desired. Problems with dependency fulfillment become especially apparent when the package manager pulls in dependencies that are several years out of date for some reason.

I eventually figured out which dependency was causing the problems and that a non-feature breaking update would solve the problem. Yay, I can get the problem solved quickly and get back to testing a new networking feature for my home lab. A yarn update node-gyp upgrade should have solved the problem.

Over 30 minutes of running around in circles trying to get yarn to update a transitive dependency. A short sequence of

  • Installing npm-check-updates
  • running npm-check-updates -u
  • and npm update

Meant I had node-gyp and several other outdated dependencies updated.

Yarn might be better than NPM for running a built Node package, but it isn’t the easiest to use when a dependency update is required.