preactjs / next-plugin-preact

Next.js plugin for preact X

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Npm 7 peerDependency issue

neneodonkor opened this issue · comments

When I run "npm install --save next next-plugin-preact preact react@npm:@preact/compat react-dom@npm:@preact/compat react-ssr-prepass@npm:preact-ssr-prepass preact-render-to-string", I get a dependency conflict error.
Screen Shot 2021-08-03 at 04 04 18
Screen Shot 2021-08-03 at 04 04 31

Are you using NPM 7? I believe you need to do npm install .... --legacy-peer-deps

@rschristian Sounds like we need to add v11 to our peer dependency definition

Yeah, I worded that poorly. "I believe you need to do ... to continue right now" is what I had meant.

Are you using NPM 7? I believe you need to do npm install .... --legacy-peer-deps

I am running NPM 7.20.3

Yeah, I worded that poorly. "I believe you need to do ... to continue right now" is what I had meant.

Oh okay sir.

Ah I found the source of the problem. Npm seems to include the version now too when resolving rewritten peerDependencies. Next depends on react ^17.0.0 and the install command rewrites that to npm:@preact/compat@0.0.4. But because 0.0.4 doesn't match 17.0.0 npm throws.

I guess problem solved. ☺️

Anyway this is the first time I am reporting an issue.

@neneodonkor Just published a new version of @preact/compat, which resolves the installation error. Thanks again for letting us now about the issue and filing a report 🙌

Thanks. I will try it again.