Error: No version of chokidar is available. Tried chokidar@2 and chokidar@3. after upgrading npm to 7.*.*
See original GitHub issueDescribe the bug
using ejected CRA , it compiles successfully and then it breaks showing below error… it started happend when i updated npm to 7 from 6
Did you try recovering your dependencies?
i tried runnung npm npm cache verify && rm -rf node_modules/ && npm i
but it did not worked
Environment
node: v14.16.0
npm: 7.9.0
OS: Linux (Ubuntu) ├── webpack-dev-server@3.11.0 ├── webpack-manifest-plugin@2.2.0 ├── webpack@4.44.2
Steps to reproduce
npm start
Expected behavior
should run the server succsessfully
Actual behavior
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)
```
Issue Analytics
- State:
- Created 2 years ago
- Reactions:21
- Comments:26
Top Results From Across the Web
javascript - Error: No version of chokidar is available. Tried ...
I got the same error when using npm@7.13.0 and was able to fix it by either downgrading to npm@7.5.4 or by running npm...
Read more >chokidar - npm
Minimal and efficient cross-platform file watching library. Latest version: 3.5.3, last published: a year ago. Start using chokidar in your ...
Read more >[Solved]-Error: No version of chokidar is available. Tried ...
Coding example for the question Error: No version of chokidar is available. Tried chokidar@2 and chokidar@3. after upgrading npm to 7.*.*-node.js.
Read more >chokidar 2 does not receive security updates since 2019 ...
Otherwise there is no error here atleast not yet ... Upgrade to chokidar 3 with 15x fewer dependencies npm WARN deprecated chokidar@2.1.8: Chokidar...
Read more >Bug #1973639 “npm install fails on newer version (12+) of node”
npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I can confirm that downgrading to
npm@7.5.4
works.It also started working with
npm@7.13.0
after runningnpm update --force
command. Looks like the reason is that after the commandwatchpack
starts using v3 of chokidar:Before update
After update
npm update --legacy-peer-deps
Worked for me, Chokidar 2 has problems with node 14v+. Upgrade to Chokidar 3 is necessary.