Skip to content

Upgrade to Node 16 and NPM 7

Axel Bocciarelli requested to merge node16 into main

Ready for review. Hope it's okay with you both @marcus.oscarsson and @loic.huder. We've made the switch without trouble on H5Web, so I thought it was worth doing here as well. Of course, if you need to keep Node 12 / NPM 6 for other projects, you'll need to use nvm, Volta or another version manager.

FYI, NPM 7 has two main changes:

  • it uses a new version of the package-lock.json format;
  • it doesn't install peer dependencies automatically.

For instance, if you have React 17 and you try to install/upgrade a dependency that requires React 16 as a peer dependency, then it won't install React 16. Instead it will log an error. You then have the option to either:

  • ignore the error and --force the installation (if you know the package is compatible and the maintainer just hasn't had time to upgrade the peer dep version range), or
  • revert to NPM 6's behaviour with --legacy-peer-deps and ask for React 16 to be installed in the dependency's inner node_modules folder.

Merge request reports