Npm run build error and cant resolve react-router-dom


Hi, i am korean who wants deploying my team’s project.
I can’t find why my deployed page show 404 error.
By searching, i added _redirects file which include /* /index.html 200. But i cant solve problem.
Also i changed build command to CI = npm run build, and change directory client/build and client/public.
But 404 error didn’t solve yet. Thanks for somebody help.

@foolcom Your build is failing.

Please fix the error that is shown:

Module not found: Error: Can't resolve 'react-router-dom' in '/opt/build/repo/client/src'
2 Likes

Hi there,

Did you see this guide yet? This is the best place to start for “Page Not Found” issues.

If you are still seeing issues after following the troubleshooting steps in there, please check out this Support Guide as well. It outlines all of our build and deploy resources and will get you on the right track :slight_smile:

If none of the above resources help, please write back with your site name and what steps you have tried and we can look into this further!

how can solve react-router-dom?
it is run successful in my local by program like visual studio.

@foolcom It’s indicating it can’t find it, presumably because it hasn’t been installed.

Ensure it’s installed in your package.json / package-lock.json.

2 Likes