You are using npm
7.x, which is more strict about peer dependencies than npm
6.x. The easiest solution is to run npm install
with the --legacy-peer-deps
flag. In theory, that may result in some incompatibility issues with peer dependencies. In practice, a lot of people do it anyway. And a lot of people are running npm
6.x and that is the default behavior there, so a lot of people are doing it perhaps without even realizing it.
In your case, @nrwl/[email protected]
says that it requires @typescript-eslint/[email protected]
and you are installing @typescript-eslint/[email protected]
. So if you don’t want to use npm
6.x or the --legacy-peer-deps
solution, another possibility is to install @typescript-eslint/[email protected]
instead of 4.31.2.
Another thing you can do is open a pull request to update @nrwl/eslint-plugin-nx
to use ^
in the relevant peerDependencies
entry instead of ~
. That will allow 4.x for the peer dependency, rather than limiting it to 4.28.x. It’s possible they limited it so severely on purpose, but probably not. (I went to look, but there are hundreds of issues opened in that repository so I didn’t spend time looking through them.)