8

I'm getting 'Error: Cannot find module '../scripts/start' from projects set up using create-react-app that previously worked fine, now when i run 'npm start' i'm getting this error - the only workaround seems to be rm -rf node_modules followed by npm install, but next day I run into the same problem. Any ideas how to fix this please (see full error message below) - thanks.

>react-scripts start

module.js:549
    throw err;
    ^

Error: Cannot find module '../scripts/start'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.resolve (internal/module.js:18:19)
    at Object.<anonymous> (/Users/DANTHORY/Dropbox/card-slider-challenge_TESTING/node_modules/.bin/react-scripts:28:25)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:191:16)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

package.json:

{
  "name":"card-slider-challenge",
  "version":"0.1.0",
  "private":true,
  "scripts":{
    "start":"react-scripts start",
    "build":"react-scripts build",
    "test":"jest",
    "eject":"react-scripts eject",
    "start-api":"json-server --port 3001 --watch --static none data/db.json"
  },
  "dependencies":{
    "react":"^16.3.2",
    "react-dom":"^16.3.2",
    "react-slick":"^0.23.2"
  },
  "devDependencies":{
    "jest":"^24.0.0",
    "json-server":"^0.12.2",
    "react-scripts":"^1.1.4"
  }
}
3
  • add .js to the end of the ../scripts/start Commented Jan 28, 2019 at 15:21
  • How does your package.json look like? Commented Jan 28, 2019 at 15:34
  • Did you ever find a fix to this? Commented Dec 5, 2019 at 17:39

2 Answers 2

2

I had the exact same issue and I did the following:

  1. Delete node_modules folder

  2. Run npm install

It fixed my issue, but what it caused, I don't know.

Sign up to request clarification or add additional context in comments.

1 Comment

According to another stackoverflow question, it appears that node_modules would not be override thoroughly when npm install is called again. So yeah, although the cause is still unknown, this is probably the best bet.
0

I changed my computer and I clone my projet from Github

  1. Delete node_modules folder

  2. Run npm install

1 Comment

This is the exact same answer as the one posted 2 years ago. I voting to close it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.