`react-scripts build' is using 1+ GB of RAM `react-scripts build' is using 1+ GB of RAM reactjs reactjs

`react-scripts build' is using 1+ GB of RAM


The answer from similar question:

You can just put --max_old_space_size for node process instead of react-script.

e.g. node --max_old_space_size=512 node_modules/.bin/react-scripts build


  1. You could add swap space on your production server. Please refer to this
  2. What node version are you using on the production server?Try to upgrade your node version using nvm or other ways. I think it is a problem for you.


I had faced a similar issue, but in my case, it helped me when I updatedthe react-scripts package that comes with CRA (create-react-app).

If your current version is 3.x.x upgrade it to the latest version of 3, you can find all the available version from here.

v3.x.x - https://github.com/facebook/create-react-app/blob/master/CHANGELOG-3.x.md

v2.x.x - https://github.com/facebook/create-react-app/blob/master/CHANGELOG-2.x.md