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

probleme while launching npx create-react-app #17006

Open
KamecheMohamedSofiane opened this issue Jan 27, 2025 · 5 comments
Open

probleme while launching npx create-react-app #17006

KamecheMohamedSofiane opened this issue Jan 27, 2025 · 5 comments

Comments

@KamecheMohamedSofiane
Copy link

2 error code ERESOLVE
33 error ERESOLVE unable to resolve dependency tree
34 error
35 error While resolving: [email protected]
35 error Found: [email protected]
35 error node_modules/react
35 error react@"^19.0.0" from the root project
35 error
35 error Could not resolve dependency:
35 error peer react@"^18.0.0" from @testing-library/[email protected]
35 error node_modules/@testing-library/react
35 error @testing-library/react@"^13.0.0" from the root project
35 error
35 error Fix the upstream dependency conflict, or retry
35 error this command with --force or --legacy-peer-deps
35 error to accept an incorrect (and potentially broken) dependency resolution.
36 error
36 error
36 error For a full report see:

@MichalRafalski
Copy link

MichalRafalski commented Jan 27, 2025

A quick workaround:

  1. First, try to create a new React project:

    npx create-react-app my-app

It will complain about React 19.

  1. Navigate to your project folder and do the following:

    • Delete the node_modules folder.

    • Open package.json and replace the following lines:

      "react": "^19.0.0",
      "react-dom": "^19.0.0",

      with:

      "react": "^18.0.0",
      "react-dom": "^18.0.0",
    • Run npm i

  2. Install the required package:

    npm install --save-dev web-vitals

then npm start works

@vanilla-tiramisu
Copy link

Still I got these problems after entering npm start at parent directory:

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:79:19)
    at Object.createHash (node:crypto:139:10)
    at module.exports (D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\webpack\lib\util\createHash.js:90:53)
    at NormalModule._initBuildHash (D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\webpack\lib\NormalModule.js:401:16)
    at handleParseError (D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\webpack\lib\NormalModule.js:449:10)
    at D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\webpack\lib\NormalModule.js:481:5  
    at D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\webpack\lib\NormalModule.js:342:12 
    at D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\loader-runner\lib\LoaderRunner.js:373:3
    at iterateNormalLoaders (D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
    at iterateNormalLoaders (D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\loader-runner\lib\LoaderRunner.js:221:10)
    at D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\loader-runner\lib\LoaderRunner.js:236:3
    at runSyncOrAsync (D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\loader-runner\lib\LoaderRunner.js:130:11)
    at iterateNormalLoaders (D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\loader-runner\lib\LoaderRunner.js:232:2)
    at Array.<anonymous> (D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\loader-runner\lib\LoaderRunner.js:205:4)
    at Storage.finished (D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:55:16)
    at D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:91:9
(node:21904) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\react-scripts\scripts\start.js:19
  throw err;
  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:79:19)
    at Object.createHash (node:crypto:139:10)
    at module.exports (D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\webpack\lib\util\createHash.js:90:53)
    at NormalModule._initBuildHash (D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\webpack\lib\NormalModule.js:401:16)
    at D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\webpack\lib\NormalModule.js:433:10 
    at D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\webpack\lib\NormalModule.js:308:13 
    at D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\loader-runner\lib\LoaderRunner.js:367:11
    at D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\loader-runner\lib\LoaderRunner.js:233:18
    at context.callback (D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
    at D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\babel-loader\lib\index.js:51:103   
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
  opensslErrorStack: [
    'error:03000086:digital envelope routines::initialization error',
    'error:0308010C:digital envelope routines::unsupported'
  ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Why did it happen? I've got no sense.

@FallingSnowFlake
Copy link

Still I got these problems after entering npm start at parent directory:

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:79:19)
    at Object.createHash (node:crypto:139:10)
    at module.exports (D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\webpack\lib\util\createHash.js:90:53)
    at NormalModule._initBuildHash (D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\webpack\lib\NormalModule.js:401:16)
    at handleParseError (D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\webpack\lib\NormalModule.js:449:10)
    at D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\webpack\lib\NormalModule.js:481:5  
    at D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\webpack\lib\NormalModule.js:342:12 
    at D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\loader-runner\lib\LoaderRunner.js:373:3
    at iterateNormalLoaders (D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
    at iterateNormalLoaders (D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\loader-runner\lib\LoaderRunner.js:221:10)
    at D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\loader-runner\lib\LoaderRunner.js:236:3
    at runSyncOrAsync (D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\loader-runner\lib\LoaderRunner.js:130:11)
    at iterateNormalLoaders (D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\loader-runner\lib\LoaderRunner.js:232:2)
    at Array.<anonymous> (D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\loader-runner\lib\LoaderRunner.js:205:4)
    at Storage.finished (D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:55:16)
    at D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:91:9
(node:21904) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\react-scripts\scripts\start.js:19
  throw err;
  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:79:19)
    at Object.createHash (node:crypto:139:10)
    at module.exports (D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\webpack\lib\util\createHash.js:90:53)
    at NormalModule._initBuildHash (D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\webpack\lib\NormalModule.js:401:16)
    at D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\webpack\lib\NormalModule.js:433:10 
    at D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\webpack\lib\NormalModule.js:308:13 
    at D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\loader-runner\lib\LoaderRunner.js:367:11
    at D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\loader-runner\lib\LoaderRunner.js:233:18
    at context.callback (D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
    at D:\Users\文档\temp\code\2025.01.27\milktea\milktea-frontend\node_modules\babel-loader\lib\index.js:51:103   
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
  opensslErrorStack: [
    'error:03000086:digital envelope routines::initialization error',
    'error:0308010C:digital envelope routines::unsupported'
  ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Why did it happen? I've got no sense.

You can refre to this link: https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported/73465262#73465262

Hope you can help :D

@FallingSnowFlake
Copy link

2 error code ERESOLVE 33 error ERESOLVE unable to resolve dependency tree 34 error 35 error While resolving: [email protected] 35 error Found: [email protected] 35 error node_modules/react 35 error react@"^19.0.0" from the root project 35 error 35 error Could not resolve dependency: 35 error peer react@"^18.0.0" from @testing-library/[email protected] 35 error node_modules/@testing-library/react 35 error @testing-library/react@"^13.0.0" from the root project 35 error 35 error Fix the upstream dependency conflict, or retry 35 error this command with --force or --legacy-peer-deps 35 error to accept an incorrect (and potentially broken) dependency resolution. 36 error 36 error 36 error For a full report see:

Your can:

  1. cd your project.
  2. npm uninstall react react-dom web-vitals
  3. npm install react@18 react-dom@18
  4. npm install web-vitals --save-dev

@GustavoKasaki
Copy link

I've had the same issue, what solved for me is to set 'legacy-peer-deps' as 'true', using the following:

npm config set legacy-peer-deps true

then:

npx create-react-app my-app

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

No branches or pull requests

5 participants