Posted about 1 month ago. Visible to the public.

Yarn: How to recognize that you are using a different node version than your colleagues

The issue in this card can occur if the node_modules directory is checked into your Git repository. We usually recommend to exclude node_modules from version control.

In any case you should document which version of node to use in your project in a .nvmrc file.


I saw a strange behaviour after we introduced webpack in one of our projects and finally found out the reason: The person who committed the files used a node version that is older than mine.

Every time I wanted to run my rails dev server I was asked to check my yarn integrity:

Copy
error Integrity check failed error Found 1 errors. ======================================== Your Yarn packages are out of date! Please run `yarn install --check-files` to update. ======================================== To disable this check, please change `check_yarn_integrity` to `false` in your webpacker config file (config/webpacker.yml). yarn check v1.16.0 info Visit https://yarnpkg.com/en/docs/cli/check for documentation about this command. Exiting

After doing exactly that with yarn install --check-files I had file changes in node_modules/.yarn-integrity:

Copy
{ - "systemParams": "linux-x64-57", + "systemParams": "linux-x64-64", "modulesFolders": [ "node_modules" ], - "flags": [], + "flags": [ + "checkFiles" + ], "linkedModules": [], "topLevelPatterns": [ "@rails/webpacker@4.x",

There were also changes in node_modules/node-sass/vendor/linux-x64-64/binding.node.

After I switched to the "correct" version of node the problems were gone.

Once an application no longer requires constant development, it needs periodic maintenance for stable and secure operation. makandra offers monthly maintenance contracts that let you focus on your business while we make sure the lights stay on.

Owner of this card:

Avatar
Judith Roth
Last edit:
about 1 month ago
by Henning Koch
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Judith Roth to makandra dev
This website uses cookies to improve usability and analyze traffic.
Accept or learn more