preactjs / next-plugin-preact

Next.js plugin for preact X
396 stars 9 forks source link

Npm 7 peerDependency issue #37

Closed neneodonkor closed 3 years ago

neneodonkor commented 3 years ago

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
rschristian commented 3 years ago

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

marvinhagemeister commented 3 years ago

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

rschristian commented 3 years ago

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

neneodonkor commented 3 years ago

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

I am running NPM 7.20.3

neneodonkor commented 3 years ago

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

Oh okay sir.

marvinhagemeister commented 3 years ago

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.

neneodonkor commented 3 years ago

I guess problem solved. ☺️

neneodonkor commented 3 years ago

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

marvinhagemeister commented 3 years ago

@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 🙌

neneodonkor commented 3 years ago

Thanks. I will try it again.