Revision: corrected commands and clarified the difference between declared, installed and runtime versions.

Check the installed React version with npm

Open a terminal in the application directory containing package.json. For a project managed with npm, run:

npm ls react react-dom --depth=0

The output shows the installed direct dependencies. A result such as react@19.0.0 identifies an installed version; it is an example, not a recommendation to install that release. An empty result can mean you are in the wrong workspace or dependencies have not been installed. Missing or invalid dependency warnings need investigation.

To inspect nested copies as well, use npm ls react --all. In a monorepo, run the command from the relevant application workspace. See the npm package listing documentation for workspace and dependency-tree options.

Declared, locked and installed versions answer different questions

Where to look for a React version
EvidenceWhat it tells you
package.jsonThe requested dependency specification. A value such as ^19.0.0 allows a range; it does not prove which version is installed.
LockfileThe versions resolved for the recorded dependency tree. A stale installation can differ from that record.
npm lsThe installed dependency tree for the project you are inspecting.
Application runtimeThe React module loaded by that particular running build. An old deployed bundle can differ from your local installation.

For a Node-based check in an npm project with dependencies installed, you can also run node -p "require('react/package.json').version". This reports the package resolved from the current directory, not every copy in a monorepo.

Check Yarn projects using the correct Yarn generation

For Yarn Classic (1.x), use:

yarn list --pattern 'react|react-dom'

For modern Yarn (2 and later), yarn why identifies the resolved package and why it belongs to the dependency tree:

yarn why react
yarn why react-dom

Use the package manager already configured for the repository. Switching package managers just to inspect a version can introduce an unrelated lockfile.

Check React in application code

Temporarily log the version from the React module used by your application:

import * as React from 'react';
console.log(React.version);

Run this inside the application build, where the package import is resolved. Pasting it into a browser console does not automatically load your app's React module. Remove the diagnostic after checking.

React Native and react-scripts have their own versions

In an npm-managed React Native project, inspect both packages:

npm ls react react-native --depth=0

The React Native package version, the React version, the operating-system version and a CLI version are different values. Do not use a CLI's version output as proof of the app's React Native version. For Expo projects, keep package upgrades aligned with the Expo SDK instead of independently installing the latest React Native.

For an existing Create React App project, the build tooling is a separate package:

npm ls react react-dom react-scripts --depth=0

The React team deprecated Create React App in February 2025. Its tooling version is not interchangeable with the React version.

Checking a version does not require upgrading it

If you decide to upgrade, first check the framework's compatibility requirements and the relevant React upgrade guide. For a compatible npm-managed web project, the package-tag syntax is:

npm install react@latest react-dom@latest

This command changes dependencies and the lockfile. It is not a version check or a universal upgrade instruction for React Native, Expo, Next.js or older build tools. Review the npm install syntax and React 19 migration requirements, then run the project's tests and production build. Keep the original lockfile in version control so the change can be reviewed.