Dan Thory
Dan Thory

Reputation: 257

react-scripts start error (Cannot find module '../scripts/start') - how can i fix this?

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"
  }
}

Upvotes: 8

Views: 3124

Answers (2)

lcom jrifi
lcom jrifi

Reputation: 1

I changed my computer and I clone my projet from Github

  1. Delete node_modules folder

  2. Run npm install

Upvotes: 0

Otti
Otti

Reputation: 404

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.

Upvotes: 2

Related Questions