[javascript] 'react-scripts' is not recognized as an internal or external command

I've got a maven project, within which is JavaScript project cloned as a git sub-module. So the directory structure looks like mavenapp/src/main/javascript/[npm project files]

Inside my package.json, the test looks like this:

"test": "react-scripts test --env=jsdom",

but when I try to run npm test, it says

'react-scripts' is not recognized as an internal or external command,

Interestingly, when I clone the javascript project independently I don't get this error. I've tried re-running npm install.

NPM version: 5.5.1
Node.js version: 9.3.0

This question is related to javascript node.js maven

The answer is


This is how I fix it

  1. Check and Update the path variable (See below on how to update the path variable)
  2. Delete node_modules and package-lock.json
  3. run npm install
  4. run npm run start

if this didn't work, try to install the nodejs and run repair

or clean npm cache npm cache clean --force

To update the path variable

  1. press windows key
  2. Search for Edit the system environmental variable
  3. Click on Environment Variables...
  4. on System variable bottom section ( there will be two section )
  5. Select Path variable name
  6. Click Edit..
  7. Check if there is C:\Program Files\nodejs on the list, if not add this

For Portable apps change

package.json

as follows

"scripts": {
    "start": "node node_modules/.bin/react-scripts start",
    "build": "node node_modules/.bin/react-scripts build",
    "test": "node node_modules/.bin/react-scripts test",
    "eject": "node node_modules/.bin/react-scripts eject"
  }

In my case , I edited my files on Linux where I had node v14.0.5 installed, when I rebooted to Windows where I had node v14.0.3 I got the same error. So I updated the node version on windows and all went fine for me.


  1. I uninstalled my Node.js and showed hidden files.

  2. Then, I went to C:\Users\yourpcname\AppData\Roaming\ and deleted the npm and npm-cache folders.

  3. Finally, I installed a new version of Node.js.


To rectify this issue follow the following steps

  1. run npm install
  2. then run npm start

This worked fine for me


For me, I just re-installed the react-scripts instead of react-scripts --save.


Running these commands worked for me:

npm cache clean --force
npm rebuild
npm install

Running the npm update command solved my problem.


If react-scripts is present in package.json, then just type this command

npm install

If react-scripts is not present in package.json, then you probably haven't installed it. To do that, run:

npm install react-scripts --save

This is rather old question but this might be of some help for future reference. Delete node_modules folder and run npm install again. Worked for me.


It is an error about react-scripts file missing in your node_modules/ directory at the time of installation.

Check your react-script dependency is avaliable or not in package.json.

If not available then add it manually via:

npm install react-scripts --save

Try:

rm -rf node_modules && npm install

Wiping node_modules first, often tends to fix a lot of weird, package related issues like that in Node.


In my case, the problem had to do with not having enough file permissions for some files the react-scripts package installation was going to write to. What solved it was running git bash as an administrator and then running npm install --save react-scripts again.


had similar issue.. i used yarn to fix it. i noticed that react-scripts was not found in my node modules so i decided to download it with npm but i seem to be failing too. so i tried yarn ( yarn add react-scripts) and that solved the nightmare! Hope this work for you as well. Happy debuging folks.


When I make a new project using React, to install the React modules I have to run "npm install" (PowerShell) from within the new projects ClientApp folder (e.g. "C:\Users\Chris\source\repos\HelloWorld2\HelloWorld2\ClientApp"). The .NET core WebApp with React needs to have the React files installed in the correct location for React commands to work properly.


This worked for me:

  • Go to the project folder in CLI and type npm install.Go for a similar command if using yarn etc.

  • Then type npm start if you are using Npm. Go for a similar command if using yarn etc.

  • The file starts working


Faced the same problem, although I am using yarn.

The following worked for me:

yarn install 
yarn start

In my situation, some problems happened with my node package. So I run npm audit fix and it fixed all problems


I have tried many of the solutions to this problem found on line, but in my case nothing worked except for reinstalling NVM for Windows (which I am using to manage multiple Node versions). In the installer, it detects installed Node versions and asks the user if they wish for NVM to control them. I said yes and NVM fixed all PATH issues. As a result, things worked as before. This issue may have multiple causes, but corrupted PATH is definitely one of them and (re)installing NVM fixes PATH.


react-scripts is not recognized as an internal or external command is related to npm.

I would update all of my dependencies in my package.json files to the latest versions in both the main directory and client directory if applicable. You can do this by using an asterisk "*" instead of specifying a specific version number in your package.json files for your dependencies.

For Example:

"dependencies": {
    "body-parser": "*",
    "express": "*",
    "mongoose": "*",
    "react": "*",
    "react-dom": "*",
    "react-final-form": "*",
    "react-final-form-listeners": "*",
    "react-mapbox-gl": "*",
    "react-redux": "*",
    "react-responsive-modal": "*",
  }

I would then make sure any package-lock.json were deleted and then run npm install and yarn install in both the main directory and the client directory as well if applicable.

You should then be able to run a yarn build and then use yarn start to run the application.


first run:

npm ci

then:

npm start

Examples related to javascript

need to add a class to an element How to make a variable accessible outside a function? Hide Signs that Meteor.js was Used How to create a showdown.js markdown extension Please help me convert this script to a simple image slider Highlight Anchor Links when user manually scrolls? Summing radio input values How to execute an action before close metro app WinJS javascript, for loop defines a dynamic variable name Getting all files in directory with ajax

Examples related to node.js

Hide Signs that Meteor.js was Used Querying date field in MongoDB with Mongoose SyntaxError: Cannot use import statement outside a module Server Discovery And Monitoring engine is deprecated How to fix ReferenceError: primordials is not defined in node UnhandledPromiseRejectionWarning: This error originated either by throwing inside of an async function without a catch block dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.62.dylib error running php after installing node with brew on Mac internal/modules/cjs/loader.js:582 throw err DeprecationWarning: Buffer() is deprecated due to security and usability issues when I move my script to another server Please run `npm cache clean`

Examples related to maven

Maven dependencies are failing with a 501 error Why am I getting Unknown error in line 1 of pom.xml? Why am I getting "Received fatal alert: protocol_version" or "peer not authenticated" from Maven Central? How to resolve Unable to load authentication plugin 'caching_sha2_password' issue Unable to compile simple Java 10 / Java 11 project with Maven ERROR Source option 1.5 is no longer supported. Use 1.6 or later 'react-scripts' is not recognized as an internal or external command How to create a Java / Maven project that works in Visual Studio Code? "The POM for ... is missing, no dependency information available" even though it exists in Maven Repository Java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/exc/InvalidDefinitionException