STUDY/Trouble Shooting๐Ÿ”จ

[์—๋Ÿฌํ•ด๊ฒฐ๐Ÿช„ ] Error: error:0308010C:digital envelope routines::unsupported : Node ๋ฒ„์ „ ๋งž์ถฐ์ฃผ๊ธฐ

JUNGY00N 2024. 1. 18. 14:43

์—๋Ÿฌ๋ฐœ์ƒ

Error: error:0308010C:digital envelope ์—๋Ÿฌ

๋„์„œ [ ์›น ๊ฐœ๋ฐœ ์Šคํ‚ฌ์„ ํ•œ ๋‹จ๊ณ„ ๋†’์—ฌ ์ฃผ๋Š” ํ”„๋ก ํŠธ์—”๋“œ์„ฑ๋Šฅ ์ตœ์ ํ™” ๊ฐ€์ด๋“œ ] ๋ฅผ ๊ณต๋ถ€ ์ค‘์ธ๋ฐ, 

์ฑ…์—์„œ ์ฃผ์–ด์ง„ ๊นƒ ๋ ˆํฌ๋ฅผ ํด๋ก  ๋ฐ›๊ณ  npm run start๋ฅผ  ํ•˜์ž๋งˆ์ž ์•„๋ž˜์™€ ๊ฐ™์€ ์—๋Ÿฌ๊ฐ€ ๋–ด๋‹ค. 

๋”๋ณด๊ธฐ
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 (/Users/choijungyoon/Desktop/webdev/FE-optimize/lecture-1/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/Users/choijungyoon/Desktop/webdev/FE-optimize/lecture-1/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/Users/choijungyoon/Desktop/webdev/FE-optimize/lecture-1/node_modules/webpack/lib/NormalModule.js:471:10)
    at /Users/choijungyoon/Desktop/webdev/FE-optimize/lecture-1/node_modules/webpack/lib/NormalModule.js:503:5
    at /Users/choijungyoon/Desktop/webdev/FE-optimize/lecture-1/node_modules/webpack/lib/NormalModule.js:358:12
    at /Users/choijungyoon/Desktop/webdev/FE-optimize/lecture-1/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/Users/choijungyoon/Desktop/webdev/FE-optimize/lecture-1/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at iterateNormalLoaders (/Users/choijungyoon/Desktop/webdev/FE-optimize/lecture-1/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
    at /Users/choijungyoon/Desktop/webdev/FE-optimize/lecture-1/node_modules/loader-runner/lib/LoaderRunner.js:236:3
    at runSyncOrAsync (/Users/choijungyoon/Desktop/webdev/FE-optimize/lecture-1/node_modules/loader-runner/lib/LoaderRunner.js:130:11)
    at iterateNormalLoaders (/Users/choijungyoon/Desktop/webdev/FE-optimize/lecture-1/node_modules/loader-runner/lib/LoaderRunner.js:232:2)
    at Array.<anonymous> (/Users/choijungyoon/Desktop/webdev/FE-optimize/lecture-1/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
    at Storage.finished (/Users/choijungyoon/Desktop/webdev/FE-optimize/lecture-1/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
    at /Users/choijungyoon/Desktop/webdev/FE-optimize/lecture-1/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
/Users/choijungyoon/Desktop/webdev/FE-optimize/lecture-1/node_modules/react-scripts/scripts/start.js:19
  throw err;
  ^

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 (/Users/choijungyoon/Desktop/webdev/FE-optimize/lecture-1/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/Users/choijungyoon/Desktop/webdev/FE-optimize/lecture-1/node_modules/webpack/lib/NormalModule.js:417:16)
    at /Users/choijungyoon/Desktop/webdev/FE-optimize/lecture-1/node_modules/webpack/lib/NormalModule.js:452:10
    at /Users/choijungyoon/Desktop/webdev/FE-optimize/lecture-1/node_modules/webpack/lib/NormalModule.js:323:13
    at /Users/choijungyoon/Desktop/webdev/FE-optimize/lecture-1/node_modules/loader-runner/lib/LoaderRunner.js:367:11
    at /Users/choijungyoon/Desktop/webdev/FE-optimize/lecture-1/node_modules/loader-runner/lib/LoaderRunner.js:233:18
    at context.callback (/Users/choijungyoon/Desktop/webdev/FE-optimize/lecture-1/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
    at /Users/choijungyoon/Desktop/webdev/FE-optimize/lecture-1/node_modules/babel-loader/lib/index.js:55:103 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

๋‹คํ–‰ํžˆ ํ•ด๋‹น ๊นƒํ—ˆ๋ธŒ์˜ Issue์—์„œ ๋‚˜์™€ ๊ฐ™์€ ์—๋Ÿฌ๋ฅผ ๊ฒช์€ ์‚ฌ๋žŒ์ด ๋‚จ๊ธด ์งˆ๋ฌธ์ด ์žˆ์–ด ์—๋Ÿฌ์— ๋Œ€ํ•œ ์›์ธ์„ ์•Œ ์ˆ˜ ์žˆ์—ˆ๋‹ค. 

์›์ธ์€ node์˜ ๋ฒ„์ „ ํ˜ธํ™˜ ๋ฌธ์ œ์˜€๋‹ค. 

node 16๋ฒ„์ „์œผ๋กœ ๋งž์ถ”๋ฉด ํ•ด๊ฒฐ๋˜๋Š” ๊ฒƒ์ด์—ˆ๋‹ค. 

node ๋ฒ„์ „์„ ๋งž์ถ”๋Š” ๊ฒƒ์„ ๋ช‡๋ฒˆ ํ•ด๋ดค์ง€๋งŒ, ์ œ๋Œ€๋กœ ์ •๋ฆฌํ•˜์ง€ ๋ชปํ•œ ๊ฒƒ ๊ฐ™์•„ ์ด๋ฒˆ ๊ธฐํšŒ์— ํฌ์ŠคํŒ…ํ•˜์—ฌ ์ •๋ฆฌํ•˜๊ฒŒ ๋˜์—ˆ๋‹ค.


๋…ธ๋“œ ๋ฒ„์ „์„ ๊ด€๋ฆฌํ•˜๋Š” ๊ฐ€์žฅ ์ผ๋ฐ˜์ ์ธ ๋ฐฉ๋ฒ•์€ nvm์„ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์ด๋‹ค. 

nvm์ด๋ž€?

"Node Version Manager"์˜ ์•ฝ์ž๋กœ, Node.js์˜ ์—ฌ๋Ÿฌ ๋ฒ„์ „์„ ์‰ฝ๊ฒŒ ์„ค์น˜ํ•˜๊ณ  ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•ด์ฃผ๋Š” ๋ฒ„์ „ ๊ด€๋ฆฌ ๋„๊ตฌ์ด๋‹ค.

์ด ๋„๊ตฌ๋Š” ํŠนํžˆ ์—ฌ๋Ÿฌ Node.js ํ”„๋กœ์ ํŠธ๋ฅผ ๋‹ค๋ฃฐ ๋•Œ ์œ ์šฉํ•˜๋ฉฐ, ๊ฐ ํ”„๋กœ์ ํŠธ์— ํ•„์š”ํ•œ Node.js์˜ ํŠน์ • ๋ฒ„์ „์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•ด์ค€๋‹ค.

nvm ์„ค์น˜ (mac)

$curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash

์„ค์น˜๋œ ๋…ธ๋“œ ๋ฒ„์ „ ๋ฆฌ์ŠคํŠธ ํ™•์ธ

$nvm list

๋…ธ๋“œ ๋ฒ„์ „ ๋ณ€๊ฒฝ

์•„๋ž˜์™€ ๊ฐ™์ด ๋ณ€๊ฒฝํ•˜๊ณ ์ž ํ•˜๋Š” ๋ฒ„์ „์„ ๋ฐ”๊ฟ”์ฃผ๋ฉด ๋œ๋‹ค.

ํ•˜์ง€๋งŒ ์ด๋Ÿฌ๋ฉด ๋ชจ๋“  ํ”„๋กœ์ ํŠธ์— ์‚ฌ์šฉ๋˜๋Š” ๋…ธ๋“œ ๋ฒ„์ „์ด ๋ฐ”๋€Œ๊ธฐ ๋•Œ๋ฌธ์—, 

ํ”„๋กœ์ ํŠธ ๋ณ„๋กœ ์‚ฌ์šฉํ•˜๋Š” ๋…ธ๋“œ ๋ฒ„์ „์„ ๋‹ค๋ฅด๊ฒŒํ•  ๊ฒฝ์šฐ ๋”ฐ๋กœ ์„ค์ •์ด ํ•„์š”ํ•˜๋‹ค. 

$nvm use 00.00

 

ํ”„๋กœ์ ํŠธ ๋ณ„ ๋…ธ๋“œ ๋ฒ„์ „ ์„ค์ •ํ•˜๊ธฐ (feat. .nvmrc)

.nvmrc ํŒŒ์ผ ์ƒ์„ฑ

๋จผ์ €, ํ”„๋กœ์ ํŠธ์˜ ๋ฃจํŠธ ๊ฒฝ๋กœ์—์„œ .nvmrc ํŒŒ์ผ์„ ์ƒ์„ฑํ•œ๋‹ค.

๊ทธ๋Ÿฌ๊ณ  ๋‚˜์„œ ์‚ฌ์šฉํ•˜๊ณ ์ž ํ•˜๋Š” ๋…ธ๋“œ ๋ฒ„์ „์„ ์ž…๋ ฅํ•œ๋‹ค.

๋…ธ๋“œ ๋ฒ„์ „ ์ ์šฉ

๊ทธ๋ฆฌ๊ณ  ํ”„๋กœ์ ํŠธ์—์„œ ํ„ฐ๋ฏธ๋„์„ ์ƒˆ๋กœ ์—ด๊ณ , ๋…ธ๋“œ ๋ฒ„์ „์„ ์ ์šฉ์‹œ์ผœ์ค€๋‹ค.

$nvm use

 

๋…ธ๋“œ ๋ฒ„์ „ ํ™•์ธ

$node -v

๋…ธ๋“œ ๋ฒ„์ „์„ ํ™•์ธํ•ด๋ณด๋ฉด, ์„ค์ •ํ•œ ๋Œ€๋กœ ๋ณ€๊ฒฝ๋œ ๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๊ณ ,

ํ•ด๋‹น ํ”„๋กœ์ ํŠธ๊ฐ€ ์•„๋‹Œ ๋‹ค๋ฅธ ํ”„๋กœ์ ํŠธ์—์„œ๋Š” ์›๋ž˜ ์‚ฌ์šฉ์ค‘์ด๋˜ node ๋ฒ„์ „์ด ๊ทธ๋Œ€๋กœ ์œ ์ง€๋˜๋Š” ๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.