Update late 2020
in step 1, you should run it as follow:
npm i @hot-loader/react-dom@YOUR_REACT_VERSION
because gatsby uses react version ^16.12.0, and running the command above without specifying react version with install ^17.0.1 which is not compatible with the ^16.x version.