-
-
Notifications
You must be signed in to change notification settings - Fork 26.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: No version of chokidar is available. Tried chokidar@2 and chokidar@3. after upgrading npm to 7.*.* #10811
Comments
OK, so this actually seems to be a Node issue, I was running 15.14 and running into this issue. I've installed This makes sense because the It looks like the chokidar requirements comes from react-scripts->webpack-dev-server and unfortunately, they don't upgrade to chokidar v3 until webpack-dev-server v4, which is still in beta. So, I guess we're stuck with running CRA on Node 12 for now. |
As far as I know, you should be able to use Node v14 so there is no need to downgrade all the way to v12. Node v14 (14.16.1) is current LTS release so it might be better to use it compared to v12. |
Yep, @marko-hologram - that's what I'm saying, 14+ isn't working, people (like OP & myself) are getting this error. It's possibly also a Windows (myself) vs Mac/Unix issue... I've been hitting a lot of weird stuff lately trying to work on a multi-OS team. |
Yeah, but I'm saying that v14 should be working and you don't need to downgrade all the way to v12. I tested on Windows only tho. |
its something definitely wrong with 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: |
I concur with @m-nathani . The issue is definitely at least partially related to |
I'm using ubuntu 20.04 and npm v7.11.1 and I'm also having the same problem here. |
Yeah, OK. My apologies, I thought it was node but it's because node installs npm alongside it. Mac running Node 15.8 and NPM 7.5.3 works fine. |
Did some more testing, 7.5.4 works, 7.5.5+ fails. |
Same here. v14.16.1 with npm 7.5.4 works as well |
i am using |
Same issue here... still no news? It's pretty critical I think... |
I can confirm that downgrading to It also started working with Before update $ npm ls chokidar
└─┬ react-scripts@4.0.3
└─┬ webpack-dev-server@3.11.1
└── chokidar@2.1.8 After update $ npm ls chokidar
└─┬ react-scripts@4.0.3
├─┬ webpack-dev-server@3.11.1
│ └── chokidar@2.1.8
└─┬ webpack@4.44.2
└─┬ watchpack@1.7.5
├── chokidar@3.5.1
└─┬ watchpack-chokidar2@2.0.1
└── chokidar@2.1.8 |
Faced this issue when I updated from npm 6 to npm 7. I have not ejected. First I just installed chokidar as a dev dependency and then it works again with Node 14.16.0 npm 7.15.0 Edit: I just tried removing the dev dependency and then using "npm update chokidar" which updated my package-lock.json it now also works without having it as a dev dependency in the package.json Why I have to do this: no idea. |
Thanks, that solved my problem. @samuliasmala |
Chockidar is a dependency inside webpack that takes care of hot reloads on save on development environment. Chockidar 2 has problems with node v14+. For me, |
I had to create a brand new "create-react-app". Then copy all my sources in the new folder (and use yarn instead of npm) lol |
lol! @alex-drocks I was about to do the same then I thought I might encounter a more nagging error. |
Yep, npm 7.17.0 failed, yarn 1.22.10 worked. I actually prefer npm, sad day, but I have to roll with what works and spend my time debugging my own mess. os: Pop!_OS 20.04 LTS (ubuntu 20.04 LTS) "react": "^17.0.2", Attempted to install chockidar with npm. Hope this helps, someone get around it and the npm or chockidar guys can fix it for the next release. |
Yay, npm is working again! Love the turnaround time on this guys! node: v14.17.1 <- nice |
I just installed chokidar as dev dependency and that works! |
I fixed it by using node v12.22.3 AND installing chokidar as a Dev Dependency nvm install 12.22.3
nvm use 12.22.3
npx create-react-app my-app
cd my-app
npm i -D chokidar
npm start |
|
npm gives the warning itself: |
It works for me using nvm with node v14.17.6 and npm 8.1.0 |
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
Browser tests are failing in the CI environment with: chokidar@3: Error: Cannot find module 'chokidar' Don't know why but this thread might be relevant: facebook/create-react-app#10811
* Update package-lock.json file * Fix broken tests in blank.spec.js Blank binary file was not getting serialized as { type: "Buffer", data: [] } because read(file) was returning a string instead of Buffer. * Fix webpack error when running browser tests Webpack 4 cannot parse module containing optional chaining operator. See https://stackoverflow.com/questions/59972341/how-to-make-webpack-accept-optional-chaining-without-babel * Fix tests in invalid.spec.js when running in Chrome * Change statusCode to status * Set the --openssl-legacy-provider flag when running browser tests Recent versions of node upgraded to OpenSSL 3.0, which deprecated some older crypto hashing algorithms including md4. Webpack 4 hard codes the use of md4 ins some places, so we have to set this flag until we can upgrade Webpack. * Use isomorphic-fetch instead of node-fetch Browser tests were failing as polyfill.js was loading a node package in a browser context. * Increase minimum version of node to 17 This was when the --openssl-legacy-provider option was introduced. Prior versions of node do not recognize this option. * Add chokidar@3 as an explicit dev dependency Browser tests are failing in the CI environment with: chokidar@3: Error: Cannot find module 'chokidar' Don't know why but this thread might be relevant: facebook/create-react-app#10811 * Skip test assertion due to conflict on Windows See also #286 * Explicitly define browsers and plugins in karma.conf.js * Replace karma-edge-launcher with newer package
* Update package-lock.json file * Fix broken tests in blank.spec.js Blank binary file was not getting serialized as { type: "Buffer", data: [] } because read(file) was returning a string instead of Buffer. * Fix webpack error when running browser tests Webpack 4 cannot parse module containing optional chaining operator. See https://stackoverflow.com/questions/59972341/how-to-make-webpack-accept-optional-chaining-without-babel * Fix tests in invalid.spec.js when running in Chrome * Change statusCode to status * Set the --openssl-legacy-provider flag when running browser tests Recent versions of node upgraded to OpenSSL 3.0, which deprecated some older crypto hashing algorithms including md4. Webpack 4 hard codes the use of md4 ins some places, so we have to set this flag until we can upgrade Webpack. * Use isomorphic-fetch instead of node-fetch Browser tests were failing as polyfill.js was loading a node package in a browser context. * Increase minimum version of node to 17 This was when the --openssl-legacy-provider option was introduced. Prior versions of node do not recognize this option. * Add chokidar@3 as an explicit dev dependency Browser tests are failing in the CI environment with: chokidar@3: Error: Cannot find module 'chokidar' Don't know why but this thread might be relevant: facebook/create-react-app#10811 * Skip test assertion due to conflict on Windows See also #286 * Explicitly define browsers and plugins in karma.conf.js * Replace karma-edge-launcher with newer package * Increase default timeout of async tests * Change package type to module * Change require/module.exports to import/export in source files * Delete "use strict" directives from source code * Update tests to ES modules * Re-export $RefParser methods as standalone functions Preserve backwards compatibility * Make karma config file a .cjs file Fixes “require() of ES Module …/config.js not supported” error * Avoid top-level await in path.js The current configuration of karma uses Webpack 4, which can't parse modules with top-level await. * Revert back to __dirname for browser tests Karma configuration needs to upgrade to Webpack 5 in order to use import.meta.url * Fix lint issues * Disable code coverage in CI for now * Revert "Disable code coverage in CI for now" This reverts commit f571f0a. * Replace nyc with c8 to work with ES modules * Implement a dual CommonJS/ES module package.json * Hack to allow $RefParser to be imported from require() without .default property Without this hack, you would have to do this: const $RefParser = require("@apidevtools/json-schema-ref-parser).default; Now you can do this: const $RefParser = require("@apidevtools/json-schema-ref-parser);
Describe 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 workedEnvironment
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
The text was updated successfully, but these errors were encountered: