mobx-devtools icon indicating copy to clipboard operation
mobx-devtools copied to clipboard

Fix mobx-devtools-mst peer dependency for MobX

Open pm7y opened this issue 3 years ago • 3 comments

Is it possible to update peer dependency on mobx to include v6?

    "mobx": "^6.3.5",
    "mobx-devtools-mst": "^0.9.30",
npm ERR! Could not resolve dependency:
npm ERR! peer mobx@"^2.2.0 || ^3.0.0 || ^4.0.0 || ^5.0.0" from [email protected]
npm ERR! node_modules/mobx-devtools-mst
npm ERR!   mobx-devtools-mst@"^0.9.30" from the root project

pm7y avatar May 17 '22 01:05 pm7y

Do you guys have a workaround for this?

Interestingly, when using yarn (v1) instead of npm, there's no such error, only a warning:

warning " > [email protected]" has incorrect peer dependency "mobx@^2.2.0 || ^3.0.0 || ^4.0.0 || ^5.0.0".

beepsoft avatar Apr 27 '23 05:04 beepsoft

A workaround I found is to add an overrides config in the package.json when using a modern version of npm.

...
	"overrides": {
		"mobx": "$mobx"
	},
...

You can read more about that setting here: https://docs.npmjs.com/cli/v9/configuring-npm/package-json#overrides

With that being said, I have no idea if mobx-devtools-mst can handle the current versions of mobx or mobx-state-tree.

basicdays avatar Apr 27 '23 18:04 basicdays