I have two questions, first is how did this happen, and second will be how can I fix this. So here's the story:
I'm working in react-native and I'm a bit of a new developer so I happily chugged along without worrying about packages going out of date. A couple of days ago, all of a sudden I can't npm install without using the --legacy-peer-deps flag. I can only roughly imagine some changes were made in a package to cause this.
Here comes the trouble. I'm using --legacy-peer-deps to npm install, I'm working on a feature, I keep refreshing the app to get hot reloads, everything is working. All of a sudden I get an error with no stack trace that seems to be coming from the packages:
Unhandled JS Exception: Unexpected token ':'. Expected a ')' or a ',' after a parameter declaration.
no stack
Googling it shows that
It's an error in react-native class -> node_modules/react-native/Libraries/Blob/URL.js
But making those fixes just leads to other issues coming from other packages, so there's a more fundamental problem.
I then decided to try and resolve my peer dependencies even though, as I understand it, this error shouldn't happen. Aren't packages free to install their dependencies? Why would this cause a conflict?
Could not resolve dependency:
npm ERR! peer typescript@">=3.2.1 <3.7.4" from eslint-config-airbnb-typescript-prettier@1.4.2
npm ERR! node_modules/eslint-config-airbnb-typescript-prettier
npm ERR! eslint-config-airbnb-typescript-prettier@"^1.4.2" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: typescript@3.7.3
My strategy was to try and adjust versions according to the errors reported, but this led me down a long line of package changes and then when the app finally builds having 100+ errors to resolve.
What's my best course of action here?
Also very curious how an error could start showing up without doing an npm install, while developing/reloading.
Edit: I'm trying my best to go through and satisfy all the dependencies/peer-dependencies, but so far it's demanding I use the newest version of React which obviously some packages don't support. It seems off.