Advice on installing latest module versions

If I upgrade to the latest versions of the core modules, I end up with multiple versions of some of the modules installed, because some of the cross-module dependencies are still pointing to older versions.

This can cause problems e.g. with instanceof tests.

What’s the advice for being on the latest versions? I think I could use resolutions in package.json to force only the latest version?

For now I’ve downgraded to the latest versions which align with the cross-module deps.

Thanks

The versions are all compatible, using ^ version ranges. So I feel “because npm upgrade is rather broken” is a more apt root cause than “because ProseMirror doesn’t re-release every single package with new dependency versions whenever one of the packages get a new release”.

The usual fix is to remove your package lock and reinstall. npm manages to deduplicate properly on reinstalling.

1 Like

If you don’t want to delete package lock (and thus update all dependencies to the latest version), you can use the dedupe command from package managers:

Great tip - thanks!

I’m on yarn 2 and this didn’t work when I tried it. I got a message “dedupe is not necessary, yarn install dedupes automatically”

What did work was manually pinning the versions of the modules that ended up with multiple installs, using "resolutions" in package.json. At the time I’m posting, these are the resolutions you need to get one version of each package

  "resolutions": {
      "prosemirror-model": "1.19.0",
      "prosemirror-state": "1.4.2",
      "prosemirror-transform": "1.7.1",
      "prosemirror-view": "1.31.1"
  }