I was getting the famous two versions loaded error. I ran the line npm ls | grep react
and got the following:
├─┬ [email protected]
├── [email protected]
├─┬ [email protected]
│ ├─┬ [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
├─┬ [email protected]
│ └─┬ [email protected]
├── [email protected]
│ ├─┬ [email protected]
│ └── [email protected]
It seems that react-dom uses [email protected]
while the rest of my project uses [email protected]
.
What do I do to make react-dom not load this older version of react? I thought that this was the most up-to-date version of react-dom.
Note: I am using npm version 2.15.1 and node version v4.4.4
Yes, it should be the same version.
dependencies are packages used in your app's production bundle. If you're building a React app, then react and react-dom would be dependencies .
4 answers. In the module you are developing, add the conflicting packages to peerDependencies (and remove them from dependencies or devDependencies ): // package. json "peerDependencies": { "react": "16.13.
What is the difference? The react package holds the react source for components, state, props and all the code that is react. The react-dom package as the name implies is the glue between React and the DOM. Often, you will only use it for one single thing: mounting your application to the index.
You can try https://docs.npmjs.com/cli/dedupe, if Nicole's comment, with clean reinstall, does not help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With