Search code examples
node.jsreactjsnpmazure-web-app-servicenvm

"sh: 1: react-scripts: not found" after running "npm run build"


Having some issues with running a Azure Static Web App that I have cloned from GitHub. Trying to follow these instructions: https://learn.microsoft.com/en-us/azure/static-web-apps/local-development. I get the error: sh: 1: react-scripts: not found after running npm run build.

In the main project folder I ran this:

npm install -g @azure/static-web-apps-cli
added 198 packages, and audited 199 packages in 31s

32 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

Ran:

npm run build
> [email protected] build
> react-scripts build

sh: 1: react-scripts: not found

What does "sh: 1: react-scripts: not found mean"? How can I fix it?

npm --version
8.1.0

node --version
v16.13.0

nvm --version
0.39.0

node --version
v16.13.0

(I realize that I probably haven't included all necessary information to understand the problem, so please tell me what more you need to know.)


Solution

  • After running npm i everything workred out fine and I was able to run the app. Thanks to @AKX :)