DEV Community

Discussion on: Error: Invalid hook call.

 
jenbutondevto profile image
Jen

yarn and npm are both package managers, but they will install slightly differently. It doesn't matter which you use, just whichever you prefer, but stick to one. I recommend you just use yarn since your readme only references yarn.

I could see that you had used npm and yarn, since you had both package.lock and yarn.lock files in your repo. I can't tell you exactly what the issue was, but it must've been the interaction between having npm installed packages and yarn installed packages causing the mismatched version. It might've been the missing dependency too. :)

you're very welcome!

Thread Thread
 
zacchnaa profile image
ZacchNaa

I was thinking react-router-dom is included in react-dom. Your input please.

Thread Thread
 
jenbutondevto profile image
Jen

when I tried to do yarn start on your project, I kept getting errors to do with react-router-dom being missing. You may have added this with npm without the --save flag. without it, it won't be added to your package.json but still installed in node_modules.yarn add will do this automatically.

p.s. my dev.to handle is @jenbutondevto :)

Thread Thread
 
zacchnaa profile image
ZacchNaa

okay @jenbutondevto thank you very much