create-react-app: After updating to 0.6.0, Error: Cannot find module 'react-dev-utils/webpackHotDevClient'
It seems create-react-app is updating very frequently right now, but there’s no guidance in how to keep an app you created with create-react-app up to date. It seems one way may be to update react-scripts via something like:
npm install --save-dev react-scripts@latest
But without any official documentation, it’s not clear if this is entirely sufficient. I just tried doing that from 0.5.1 to 0.6.0 and I got an error:
pbeshai: ~/Workspace/my-project $ npm start
> my-project@0.1.0 start /Users/pbeshai/Workspace/my-project
> react-scripts start
module.js:442
throw err;
^
Error: Cannot find module 'react-dev-utils/webpackHotDevClient'
at Function.Module._resolveFilename (module.js:440:15)
at Function.resolve (internal/module.js:27:19)
at Object.<anonymous> (/Users/pbeshai/Workspace/my-project/node_modules/react-scripts/config/webpack.config.dev.js:56:13)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/pbeshai/Workspace/my-project/node_modules/react-scripts/scripts/start.js:31:14)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
This error is resolved by running:
npm install --save-dev react-dev-utils
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 4
- Comments: 37 (20 by maintainers)
Isn’t it the very first section in the User Guide? It’s linked from main README, too.
https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#updating-to-new-releases
Yes, of course. If you have problems please file a new issue with instructions to reproduce.
Note that if you’re using npm 5 you’re probably hitting one of its many bugs. Please try downgrading to npm 4 in the meantime.
npm install -g npm@4
Filed as https://github.com/npm/npm/issues/14073.
So basically npm lied that it installed
react-dev-utils@0.2.0
but really kept0.1.1
😕Added in cc97ed5636e468d94a9769be88513f2c31d1f8bd.
I think the problem was that I just Cmd+F’d “update” on the README and found nothing. It’s actually very well documented there in the user guide.