Reputation: 4285
using ejected CRA , it compiles successfully and then it breaks showing below error.. it started happend when i updated npm to 7 from 6
You can now view webrms in the browser.
Local: http://localhost:3001
On Your Network: http://192.168.0.160:3001
Note that the development build is not optimized.
To create a production build, use npm run build.
/home/murtaza/umai/webrms/node_modules/watchpack/lib/chokidar.js:17
throw new Error(
^
Error: No version of chokidar is available. Tried chokidar@2 and chokidar@3.
You could try to manually install any chokidar version.
chokidar@3: Error: Cannot find module 'chokidar'
Require stack:
- /home/murtaza/umai/webrms/node_modules/watchpack/lib/chokidar.js
- /home/murtaza/umai/webrms/node_modules/watchpack/lib/DirectoryWatcher.js
- /home/murtaza/umai/webrms/node_modules/watchpack/lib/watcherManager.js
- /home/murtaza/umai/webrms/node_modules/watchpack/lib/watchpack.js
- /home/murtaza/umai/webrms/node_modules/webpack/lib/node/NodeWatchFileSystem.js
- /home/murtaza/umai/webrms/node_modules/webpack/lib/node/NodeEnvironmentPlugin.js
- /home/murtaza/umai/webrms/node_modules/webpack/lib/webpack.js
- /home/murtaza/umai/webrms/scripts/start.js
chokidar@2: Error: Cannot find module 'watchpack-chokidar2'
Require stack:
- /home/murtaza/umai/webrms/node_modules/watchpack/lib/chokidar.js
- /home/murtaza/umai/webrms/node_modules/watchpack/lib/DirectoryWatcher.js
- /home/murtaza/umai/webrms/node_modules/watchpack/lib/watcherManager.js
- /home/murtaza/umai/webrms/node_modules/watchpack/lib/watchpack.js
- /home/murtaza/umai/webrms/node_modules/webpack/lib/node/NodeWatchFileSystem.js
- /home/murtaza/umai/webrms/node_modules/webpack/lib/node/NodeEnvironmentPlugin.js
- /home/murtaza/umai/webrms/node_modules/webpack/lib/webpack.js
- /home/murtaza/umai/webrms/scripts/start.js
at Object.<anonymous> (/home/murtaza/umai/webrms/node_modules/watchpack/lib/chokidar.js:17:7)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (/home/murtaza/umai/webrms/node_modules/watchpack/lib/DirectoryWatcher.js:9:16)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
does anyone have facing same issue if yes then whats the solution ?
Upvotes: 7
Views: 10699
Reputation: 2351
I got the same error when using [email protected]
and was able to fix it by either downgrading to [email protected]
or by running npm update --force
command.
Upvotes: 5
Reputation: 4285
its something definitely wrong with npm 7.*.*
.. i tried npm i --legacy-peer-deps
and it worked for me...
however it shouldn't be like this and dependencies should handled in latest stable version..
here is the detailed reasoning of why it may cause:
Upvotes: 1
Reputation: 62
Try:
npm i --legacy-peer-deps
For more information have a look on:
https://github.com/facebook/create-react-app/issues/10811
Upvotes: 4