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

๐Ÿ“š/Computer Science

[ํŒจํ‚ค์ง€๋งค๋‹ˆ์ €] npm์ด๋ž€?

 

๐Ÿ”— npm(Node Package Manager)์ด๋ž€?

 

 ๋ง ๊ทธ๋Œ€๋กœ '๋…ธ๋“œ ํŒจํ‚ค์ง€ ๋งค๋‹ˆ์ €'๋กœ, ํŠน์ • ๊ธฐ๋Šฅ์„ ํ•˜๋Š” ์ž๋ฐ” ์Šคํฌ๋ฆฝํŠธ ํŒจํ‚ค์ง€๊ฐ€ ํ•„์š”ํ•˜๋ฉด npm์—์„œ ์ฐพ์•„ ์„ค์น˜ํ•˜๋ฉด ๋œ๋‹ค. ํŒจํ‚ค์ง€๊ฐ€ ๋‹ค๋ฅธ ํŒจํ‚ค์ง€๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜๋„ ์žˆ๋Š”๋ฐ ์ด๋ฅผ '์˜์กด ๊ด€๊ณ„'๋ผ๊ณ  ํ•œ๋‹ค.

 

 

๐Ÿ“Œ npm vs yarn

 

 yarn์€ ํŽ˜์ด์Šค๋ถ์—์„œ ๋งŒ๋“  ํŒจํ‚ค์ง€ ๋งค๋‹ˆ์ €์ด๋‹ค. npm์˜ ์ผ๊ด€์„ฑ, ๋ณด์•ˆ, ๋นŒ๋“œ์‹œ ์„ฑ๋Šฅ ๋“ฑ์˜ ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•ด yarn์„ ๋งŒ๋“ค์—ˆ๋‹ค.

 npm์€ ํŒจํ‚ค์ง€๋“ค์ด ์ฝ”๋“œ๋ฅผ ์ž๋™์ ์œผ๋กœ ์ฆ‰์‹œ ์‹คํ–‰ํ•˜๋Š” ๊ฒƒ์„ ํ—ˆ์šฉํ•  ๋ฟ๋งŒ ์•„๋‹ˆ๋ผ ์˜์กด์„ฑ๋“ค๋„ ์ฆ‰์‹œ ์ž๋™์ ์œผ๋กœ ์‹คํ–‰๋˜์–ด ํŽธ๋ฆฌํ•จ์„ ์ œ๊ณตํ•˜๊ธฐ๋„ ํ•˜์ง€๋งŒ, ๋ณด์•ˆ์— ์œ„ํ—˜์ด ์žˆ์„ ์ˆ˜ ์žˆ๋‹ค. ์ด์™€ ๋‹ค๋ฅด๊ฒŒ yarn์€ ์˜ค์ง yarn.lock ํ˜น์€ package.json๋กœ ๋ถ€ํ„ฐ ์„ค์น˜๋˜์–ด yarn.lock์€ ๋ชจ๋“  ์žฅ์น˜๋“ค์ด ๊ฐ™์€ ํŒจํ‚ค์ง€๋“ค์„ ์„ค์น˜ํ•˜๋Š” ๊ฒƒ์„ ๋ณด์ฆํ•ด์ค€๋‹ค. ๊ทธ๋Ÿฌ๋ฏ€๋กœ ํŒจํ‚ค์ง€์˜ ์ฐจ์ด๋กœ๋ถ€ํ„ฐ ๋ฐœ์ƒํ•˜๋Š” ๋ฒ„๊ทธ์˜ ํ™•๋ฅ ์„ ํ˜„์ €ํ•˜๊ฒŒ ๊ฐ์†Œ์‹œํ‚จ๋‹ค.

+ npm์—์„œ ํŒจํ‚ค์ง€๋ฅผ ์„ค์น˜ ํ–ˆ์„ ๋•Œ ์ด์ „๊ณผ ๋ฒ„์ „์ •๋ณด๊ฐ€ ๋‹ค๋ฅธ ํ™˜๊ฒฝ๋ฌธ์ œ๊ฐ€ ์ƒ๊ธธ ์ˆ˜ ์žˆ์—ˆ๋Š”๋ฐ ์ด๊ฒƒ์„ yarn์˜ yarn.lock ํŒŒ์ผ์—์„œ ์ฒ˜๋ฆฌํ•  ์ˆ˜ ์žˆ์—ˆ๋‹ค. ํ•˜์ง€๋งŒ, ํ˜„์žฌ๋Š” npm์˜ package-lock.json์—์„œ ์ด ์ฒ˜๋ฆฌ๋ฅผ ๋™์ผํ•˜๊ฒŒ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค.

 

 

npm | build amazing things

Build amazing things We're npm, Inc., the company behind Node package manager, the npm Registry, and npm CLI. We offer those to the community for free, but our day job is building and selling useful tools for developers like you. Take your JavaScript devel

www.npmjs.com

 

Yarn

Fast, reliable, and secure dependency management.

classic.yarnpkg.com

 


๐Ÿ”Ž ์ฐธ๊ณ  ์ž๋ฃŒ

๐Ÿ’ก ๊ฐ™์ด ๋ณด๋ฉด ์ข‹์„ Post

 

[ํŒจํ‚ค์ง€๋งค๋‹ˆ์ €] package.json์ด๋ž€?

๐Ÿ”— package.json์ด๋ž€?  ํ”„๋กœ์ ํŠธ ์ •๋ณด๋ฅผ ๊ด€๋ฆฌํ•˜๋Š” ํŒŒ์ผ์ด๋‹ค. ์–ด๋Š ๊ณณ์—์„œ๋„ ๋™์ผํ•œ ๊ฐœ๋ฐœํ™˜๊ฒฝ์„ ๊ตฌ์ถ•ํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•ด์ค€๋‹ค. ๐Ÿ”— dependencies vs devDependencies  dependencies๋Š” ํŒจํ‚ค์ง€์˜ ๋ฐฐํฌ ์‹œ ํฌํ•จ๋  ์˜์กด์„ฑ.

devjindev.tistory.com