When running tests in React with Enzyme, I am getting the following error:
"Error: Package subpath './lib/utils' is not defined by "exports" in ...\node_modules\cheerio\package.json."
Cheerio is a dependency of Enzyme. The file in question does exist in the node_modules directory as expected. This error seems to have started when updating Node.js locally from 12.16.1 to 16.15.1.
I am running: React: 17.0.2 Enzyme: 13.11.0 Node.js: 16.15.1
https://github.com/cheeriojs/cheerio/releases new version of cheerio was released. Enzym uses cheerio as dependency. Use prev version cheerio@1.0.0-rc.10 until fix