๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

TIL

package.json์—์„œ dependencies ์ตœ์‹  ๋ฒ„์ „์œผ๋กœ ์—…๋ฐ์ดํŠธํ•˜๊ธฐ

Next.js๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ง„ํ–‰ํ•˜๊ณ  ์žˆ๋Š” ์‚ฌ์ด๋“œ ํ”„๋กœ์ ํŠธ์—์„œ ์„œ๋“œํŒŒํ‹ฐ ์Šคํฌ๋ฆฝํŠธ๊ฐ€ ๋“ค์–ด๊ฐ€๋Š”๋ฐ ์•„๋ฌด๋ฆฌ next/script๋ฅผ ์‚ฌ์šฉํ•ด๋ด๋„ ๋กœ๋“œ๊ฐ€ ๋˜์ง€ ์•Š๋Š” ๊ฒƒ์ด์—ˆ๋‹ค... ๊ตฌ๊ธ€์„ ํ—ค์ง‘๊ณ  ๋‹ค๋‹ˆ๋‹ค๋ณด๋‹ˆ ๋‚˜์™€ ๋น„์Šทํ•œ ๊ฒฝํ—˜์„ ํ•œ ๊ฐœ๋ฐœ์ž๋“ค์ด ์žˆ์—ˆ๊ณ  Next 12.1.6 ์— ๋ฒ„๊ทธ๊ฐ€ ์žˆ์—ˆ์œผ๋‹ˆ 12.2.0์œผ๋กœ ์—…๋ฐ์ดํŠธํ•˜๊ณ  ์‹œ๋„ํ•ด๋ณด๋ผ๋Š” ๊ฒƒ์ด์—ˆ๋‹ค. 

๊ทธ๋ž˜์„œ ์ž‘์„ฑํ•˜๊ฒŒ ๋œ package.json์—์„œ dependencies ์ตœ์‹  ๋ฒ„์ „์œผ๋กœ ์—…๋ฐ์ดํŠธํ•˜๊ธฐ!

์ด ๊ธ€์€ ์Šคํƒ์˜ค๋ฒ„ํ”Œ๋กœ์šฐ์—์„œ ์•„๋ž˜์˜ ๊ธ€์„ ์ฐธ๊ณ ํ–ˆ๋‹ค. 
https://stackoverflow.com/questions/16073603/how-to-update-each-dependency-in-package-json-to-the-latest-version

 

How to update each dependency in package.json to the latest version?

I copied package.json from another project and now want to bump all of the dependencies to their latest versions since this is a fresh project and I don't mind fixing something if it breaks. What's...

stackoverflow.com

npm i -g npm-check-updates
ncu -u
npm install

์œ„์˜ ์ˆœ์„œ๋กœ ์ž…๋ ฅํ•ด์ฃผ๋ฉด ๋˜๋Š”๋ฐ 
npm i -g npm-check-updates๋Š” npm-check-updates๋ฅผ ํ”„๋กœ์ ํŠธ ๋ฟ๋งŒ ์•„๋‹ˆ๋ผ ์ž์‹ ์˜ pc์— ์„ค์น˜ํ•˜๋Š” ๊ฒƒ์„ ์˜๋ฏธํ•˜๊ณ  
ncu -u๋Š” ํ”„๋กœ์ ํŠธ์˜ package.json์˜ ๋ฒ„์ „์„ ์—…๋ฐ์ดํŠธํ•ด์ค€๋‹ค. 
npm install์„ ํ†ตํ•ด์„œ ์—…๋ฐ์ดํŠธ๋œ ๋ฒ„์ „์œผ๋กœ ํŒจํ‚ค์ง€๋“ค์„ ๋‹ค์šด๋กœ๋“œ ํ•ด์ค€๋‹ค. 

์ฐธ๊ณ ๋กœ 12.2.0์—์„œ ์„œ๋“œํŒŒํ‹ฐ ์Šคํฌ๋ฆฝํŠธ ๋กœ๋“œ๊ฐ€ ์ž˜ ๋œ๋‹ค๐Ÿ‘