react-app-rewired: react-app-rewired: command not found

I install this package in ‘devDependencies’,

  "devDependencies": {
    "customize-cra": "^1.0.0",
    "react-app-rewired": "^2.1.6",
    "typescript": "^3.7.5"
  }

then config everything as readme.md said, then ‘npm start’,

  "scripts": {
    "start": "react-app-rewired start",
    "build": "react-app-rewired build",
    "test": "react-app-rewired test",
    "eject": "react-scripts eject"
  },

i got this error:

> react-app-rewired start

sh: react-app-rewired: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 25 (1 by maintainers)

Most upvoted comments

Did you run npm install after adding react-app-rewired to your dev dependencies?

I just had the same issue on windows. Project was using yarn. I deleted node_modules and yarn.lock. Ran npm i - got 'react-app-rewired' is not recognized as an internal or external command Ran npm i react-app-rewired and everything worked again.

Also had to to reinstall node-sass manually, so something properly broke.

Had this in the log.

9 verbose lifecycle playground@0.0.9~start: CWD: C:\***
10 silly lifecycle playground@0.0.9~start: Args: [ '/d /s /c', 'react-app-rewired start' ]
11 silly lifecycle playground@0.0.9~start: Returned: code: 1  signal: null
12 info lifecycle playground@0.0.9~start: Failed to exec start script
13 verbose stack Error:playground@0.0.9 start: `react-app-rewired start`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (**\AppData\Roaming\nvm\v12.16.1\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:311:20)
13 verbose stack     at ChildProcess.<anonymous> (C:**\AppData\Roaming\nvm\v12.16.1\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:311:20)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid playground@0.0.9
15 verbose cwd C:\****playground
16 verbose Windows_NT 6.3.9600
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"

Was the issue ever solved? I am having this exact issue. And I answer yes to all of those questions above.

If running on a mac, may need to use sudo npm install. Look at the results of that.

@dawnmist You are right. Thanks! Works fine with Windows WSL

@meirkl I have tried checking out that repository and tried running the above commands and everything worked correctly, but as my test machine is linux I am suspicious that the issue may be related to the difference in path handling between linux & windows.

The BrewUNO project mentions that you will need to use Git Bash if you are under windows in their readme documentation. Your log error messages appear to indicate that you are running with PowerShell instead. If that is true, can I suggest that you try running with the git bash shell to check that it’s not simply an incompatibility with PowerShell?