Accepted answer

To bump the version of your app you can use npm version.

For example:

npm version minor


You can use grunt-bump to handle your app versioning. As for displaying your app version, refer to Is there a way to get version from package.json in nodejs code?.


I don't think the answers from @Bertrand P or @VulfCompressor tell the complete picture. I used genversion The steps I did were:

  1. npm install genversion --save-dev
  2. Modify the build script in package.json to genversion --es6 src/autobuild_version.js && react-scripts build (I couldn't figure out a way to import the generated module from the lib directory as suggested in the genversion documentation so I had to put it in the src directory instead)
  3. In the React app, import { version } from './autobuild_version' and use as appropriate
  4. Add src/autobuild_version.js to .gitignore (other source code control tools are available)
  5. npm run build


Once you have a way to bump the version in package.json (e.g. npm version, as suggested by @bertrand-p), you can then assign the version to an environment variable. For example, in .env you can set:


Then you can access the variable from within your app via process.env.REACT_APP_VERSION.

See also:

Related Query

More Query from same tag