question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

react-scripts 4.0.1 errors out during npm install

See original GitHub issue

When using react-scripts version 4.0.0, attempting to run npm i causes an error. The following is then displayed:

npm ERR! Cannot read property 'matches' of undefined

This is specific to version 4.0.0, as everything installs fine with version 3.4.3.

Of note is the fact that the yarn installation works fine. (Sadly I do need to use npm when deploying.)

Here is what was run prior to the installation attempt:

rm -rf node_modules/ rm package-lock.json npm cache clear --force

Node version: 15.0.1, npm version: 7.0.7.

If this is relevant here’s the entire dependency list:

"dependencies": { "@amcharts/amcharts4": "^4.10.9", "@amcharts/amcharts4-geodata": "^4.1.18", "react": "^17.0.1", "react-dom": "^17.0.1", "react-scripts": "4.0.0", "react-router-dom": "^5.2.0" }, "devDependencies": { "eslint": "^7.12.1", "eslint-config-airbnb": "^18.2.0", "eslint-plugin-import": "^2.22.1", "eslint-plugin-jsx-a11y": "^6.4.1", "eslint-plugin-react": "^7.21.5", "eslint-plugin-react-hooks": "^4.2.0" },

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:16
  • Comments:17

github_iconTop GitHub Comments

7reactions
Alaricuscommented, Nov 15, 2020

A bit of an update now that npm 7.0.10 is out and provides more verbose errors:

npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! Found: type-fest@0.8.1 npm ERR! node_modules/type-fest npm ERR! type-fest@"^0.8.1" from globals@12.4.0
npm ERR! node_modules/globals npm ERR! globals@"^12.1.0" from eslint@7.13.0 npm ERR! node_modules/eslint npm ERR! dev eslint@"^7.12.1" from the root project npm ERR! 15 more (eslint-config-airbnb, eslint-plugin-import, ...) npm ERR! globals@"^12.1.0" from @eslint/eslintrc@0.2.1 npm ERR! node_modules/@eslint/eslintrc npm ERR! @eslint/eslintrc@"^0.2.1" from eslint@7.13.0 npm ERR! node_modules/eslint npm ERR! dev eslint@"^7.12.1" from the root project npm ERR! 15 more (eslint-config-airbnb, eslint-plugin-import, ...) npm ERR! npm ERR! Could not resolve dependency: npm ERR! peerOptional type-fest@"^0.13.1" from @pmmmwh/react-refresh-webpack-plugin@0.4.2 npm ERR! node_modules/@pmmmwh/react-refresh-webpack-plugin npm ERR! @pmmmwh/react-refresh-webpack-plugin@"0.4.2" from react-scripts@4.0.0 npm ERR! node_modules/react-scripts npm ERR! react-scripts@"4.0.0" from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force, or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

6reactions
oserbancommented, Nov 24, 2020

npm i -S type-fest solved the issue for me, but npm is definitely solving the wrong dependency/version on this one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

create-react-app is not working since version 4.0.1
You have create-react-app installed globally. Use this command to find out if you do: npm list -g --depth 0 . If so, follow...
Read more >
react-scripts - npm
Configuration and scripts for Create React App.. ... Start using react-scripts in your project by running `npm i react-scripts`.
Read more >
command failed: npm install --save --save-exact react-native ...
The solution for ” Command `npm install –save –save-exact react-native` failed ” can be found here. The following code will assist you in...
Read more >
How to fix 'Module not found: Can't resolve 'http' in ... - YouTube
Basically, just change ' react - scripts ' to 4.0.2 in your package.json and run ` npm install ` again :D ...
Read more >
react-scripts | Yarn - Package Manager
react -scripts. #12245 fix: webpack noise printed only if error or warning (@Andrew47) · create-react-app. #11915 Warn when not using the latest version...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found