rexrainbow / phaser3-rex-notes

Notes of phaser3 engine
MIT License
1.21k stars 262 forks source link

NPM Install Could Not Resolve Dependency #452

Closed hnegus1 closed 3 months ago

hnegus1 commented 3 months ago

Hey,

When I try to run npm install on the project I get a dependency error.

This is run on a completely fresh repo. Node v21.5.0 NPM v10.2.4, Windows 10. I also downgraded to Node V16 to test but still the same issue. If this still works on your environment, could you give me your Node version number to test?

I've looked around and found this issue on browser-sync-webpack-plugin which looks to be identical, with people suggesting this package as a replacement. With that said, I am not familiar at all with BrowserSync so I can't say if this is a good solution.

npm resolution error report

While resolving: browser-sync-webpack-plugin@2.3.0 Found: browser-sync@3.0.2 node_modules/browser-sync dev browser-sync@"^3.0.2" from the root project

Could not resolve dependency: peer browser-sync@"^2" from browser-sync-webpack-plugin@2.3.0 node_modules/browser-sync-webpack-plugin dev browser-sync-webpack-plugin@"^2.3.0" from the root project

Conflicting peer dependency: browser-sync@2.29.3 node_modules/browser-sync peer browser-sync@"^2" from browser-sync-webpack-plugin@2.3.0 node_modules/browser-sync-webpack-plugin dev browser-sync-webpack-plugin@"^2.3.0" from the root project

Fix the upstream dependency conflict, or retry this command with --force or --legacy-peer-deps to accept an incorrect (and potentially broken) dependency resolution.

rexrainbow commented 3 months ago

I use node v14.18.1, on window 11. Remove current node_modules folder and re-install by npm install. All works well. Your previous solution -- modify package locally is a nice solution.

hnegus1 commented 3 months ago

Hey, apologies for the delay.

It looks like NodeJS 14.18.1 did the trick for me. I'm happy to simply use this version if I ever need to develop with this project again.