Skip to content
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

npm update fails in CRA app after node-sass #10749

Closed
petersowa opened this issue Mar 25, 2021 · 15 comments
Closed

npm update fails in CRA app after node-sass #10749

petersowa opened this issue Mar 25, 2021 · 15 comments

Comments

@petersowa
Copy link

petersowa commented Mar 25, 2021

Describe the bug

After the install of node-sass in a newly create CRA app, npm update fails with below error.

npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: @babel/core@7.12.3
npm ERR! node_modules/@babel/core
npm ERR!   @babel/core@"7.12.3" from react-scripts@4.0.3
npm ERR!   node_modules/react-scripts
npm ERR!     react-scripts@"^4.0.3" from the root project
npm ERR!   @babel/core@"^7.12.3" from @svgr/webpack@5.5.0
npm ERR!   node_modules/@svgr/webpack
npm ERR!     @svgr/webpack@"5.5.0" from react-scripts@4.0.3
npm ERR!     node_modules/react-scripts
npm ERR!       react-scripts@"^4.0.3" from the root project
npm ERR!   9 more (babel-jest, babel-loader, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @babel/core@"^7.13.0" from @babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.13.12
npm ERR! node_modules/@babel/preset-env/node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining
npm ERR!   @babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@"^7.13.12" from @babel/preset-env@7.13.12
npm ERR!   node_modules/@babel/preset-env
npm ERR!     @babel/preset-env@"^7.12.1" from @svgr/webpack@5.5.0
npm ERR!     node_modules/@svgr/webpack
npm ERR!       @svgr/webpack@"5.5.0" from react-scripts@4.0.3
npm ERR!       node_modules/react-scripts
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.
npm ERR!
npm ERR! See C:\Users\peter\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\peter\AppData\Local\npm-cache\_logs\2021-03-25T20_42_43_029Z-debug.log

Did you try recovering your dependencies?

Yes, cleared npm cache and setup new project.

Environment

- create-react-app version: 4.0.3
- NPM version: 7.7.4
- Node version: v14.16.0
- Node Process: {
  node: '14.16.0',
  v8: '8.4.371.19-node.18',
  uv: '1.40.0',
  zlib: '1.2.11',
  brotli: '1.0.9',
  ares: '1.16.1',
  modules: '83',
  nghttp2: '1.41.0',
  napi: '7',
  llhttp: '2.1.3',
  openssl: '1.1.1j',
  cldr: '37.0',
  icu: '67.1',
  tz: '2020a',
  unicode: '13.0'
}
- Node Platform: win32
- Node architecture: x64
- node-sass version: 
    node-sass       5.0.0   (Wrapper)       [JavaScript]
    libsass         3.5.5   (Sass Compiler) [C/C++]

- npm node-sass versions:
├── node-sass@5.0.0
└─┬ react-scripts@4.0.3
  └─┬ sass-loader@10.1.1
    └── node-sass@5.0.0 deduped

Steps to reproduce

  1. npx create-react-app test3 typescript --use-npm
  2. npm install node-sass
  3. npm update
@SirPryderi
Copy link

I've got the same issue, did anyone find a fix?

@RusimbiPatrick
Copy link

This is an issue in npm version 7+. @petersowa and @SirPryderi. You will need to downgrade your npm versions to the stable 6.14.11

Solution: npm install npm@6.14.11 -g

@petersowa
Copy link
Author

I've got the same issue, did anyone find a fix?

For a workaround I switched to yarn.

@RusimbiPatrick
Copy link

I've got the same issue, did anyone find a fix?

For a workaround I switched to yarn.

Brilliant move @petersowa. Yarn is better than npm in numerous things

@petersowa
Copy link
Author

Closing as this appears to be an NPM issue.

@mxcl
Copy link

mxcl commented Mar 31, 2021

Possibly npm/cli#2999

@DeryabinSergey
Copy link

Work with npm version 7.8.0

@orc13a
Copy link

orc13a commented Apr 8, 2021

Work with npm version 7.8.0

I am having this issue with npm 7.8.0

@DeryabinSergey
Copy link

DeryabinSergey commented Apr 8, 2021

Work with npm version 7.8.0

I am having this issue with npm 7.8.0

I add in my composer.json "@babel/core": "^7.13.14"

@paramore2k
Copy link

Updated to the newest version of NPM and added npm install --save-dev @babel/core. No more update fails with node-sass.

@Akhil-EM
Copy link

This is an issue in npm version 7+. @petersowa and @SirPryderi. You will need to downgrade your npm versions to the stable 6.14.11

Solution: npm install npm@6.14.11 -g

thanks a lot, this helped me

@edocbuhtig
Copy link

Solution from @paramore2k Worked, thanks

@pavantanniru
Copy link

i'm having the issue with the npm ..(latest version of the npm is : 7.16.0

@edocbuhtig
Copy link

@pavantanniru try using latest node 14.17.1

@orassayag
Copy link

npm install npm@6.14.11 -g

I had NPM version 7.20.0. Downgrading to 5.14.11 works like a magic. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests