paulsevere / react-electron-scripts

The Unlicense
5 stars 0 forks source link

Error: Cannot find module 'chokidar' on npm start #2

Closed jatins closed 7 years ago

jatins commented 7 years ago

I replaced react-scripts in devDependencies in project created by create-react-app with "react-electron-scripts": "^0.4.2"

Running npm start results in this error.

Error: Cannot find module 'chokidar'
lerna ERR! execute     at Function.Module._resolveFilename (module.js:470:15)
lerna ERR! execute     at Function.Module._load (module.js:418:25)
lerna ERR! execute     at Module.require (module.js:498:17)
lerna ERR! execute     at require (internal/module.js:20:19)
lerna ERR! execute     at Object.<anonymous> (/Users/jasn/TestApp/packages/app/node_modules/react-electron-scripts/node_modules/webpack-dev-server/lib/Server.js:4:18)
lerna ERR! execute     at Module._compile (module.js:571:32)
lerna ERR! execute     at Object.Module._extensions..js (module.js:580:10)
lerna ERR! execute     at Module.load (module.js:488:32)
lerna ERR! execute     at tryModuleLoad (module.js:447:12)
lerna ERR! execute     at Function.Module._load (module.js:439:3)

(Did npm install before this)

npm -v 5.0.3 node -v v7.3.0 OS macOS ElCapitan

paulsevere commented 7 years ago

Had you already ejected before attempting this?

jatins commented 7 years ago

No, I did not eject. I just replaced react-scripts with react-electron-scripts in devDeps.

Also, update: I was able to get rid of that error by deleting the node_modules and package-lock files and doing a fresh install. (Pretty sure that's a bad idea). Not sure what was causing the error, thought. (Also, the fact that I was also experimenting with lerna makes me even less sure what was causing the issue)

paulsevere commented 7 years ago

Interesting. I am trying to recreate the issue and getting errors because the template isn't updating (the electron process directory isn't present in my directory, etc.). Did you run into this same issue?

jatins commented 7 years ago

Don't think I got an error like that. Also, just to be clear on how I am using react-electron-scripts:

  1. Create react app with create-react-app appName (No scripts flag)
  2. Replace react-scripts with react-electron-scripts in devDependencies.

So, I am not really using the included template.

paulsevere commented 7 years ago

Ooo I see, that makes more sense.