PROGRAMING/React

[REACT] React Router

donghunl 2024. 2. 15. 10:31
반응형

install :

$ npm install react-router-dom
# or, for a React Native app
$ npm install react-router-native

 

If you get below error when you intall react router.

 

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:68:19)
    at Object.createHash (node:crypto:138:10)
    at module.exports (C:\Dev\WorkSpace\React\Exercise Files\main\react-app\node_modules\webpack\lib\util\createHash.js:90:53)
    at NormalModule._initBuildHash (C:\Dev\WorkSpace\React\Exercise Files\main\react-app\node_modules\webpack\lib\NormalModule.js:401:16)
    at C:\Dev\WorkSpace\React\Exercise Files\main\react-app\node_modules\webpack\lib\NormalModule.js:433:10
    at C:\Dev\WorkSpace\React\Exercise Files\main\react-app\node_modules\webpack\lib\NormalModule.js:308:13
    at C:\Dev\WorkSpace\React\Exercise Files\main\react-app\node_modules\loader-runner\lib\LoaderRunner.js:367:11
:233:18
    at context.callback (C:\Dev\WorkSpace\React\Exercise Files\main\react-app\node_modules\loader-runner\l    at C:\Dev\WorkSpace\React\Exercise Files\main\react-app\node_modules\babel-loader\lib\index.js:51:103 {  
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

 

The Correct (safe) Solution (for npm users)

Use an up-to-date version of Node.js, and also use packages that are up-to-date with security fixes.

For many people, the following command will fix the issue:

npm audit fix --force

 

반응형