๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
Frontend/JavaScript

[ ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ(JavaScript) ] terminal์—์„œ npm private ํŒจํ‚ค์ง€๋ฅผ ๋‹ค์šด๋ฐ›์„ ์ˆ˜ ์—†์„ ๋•Œ

by YWTechIT 2022. 5. 6.
728x90
728x90

๐Ÿ“ terminal์—์„œ npm private ํŒจํ‚ค์ง€๋ฅผ ๋‹ค์šด๋กœ๋“œํ•  ์ˆ˜ ์—†์„ ๋•Œ

React์—์„œ npm i๋ฅผ ํ†ตํ•ด ํ•„์š”ํ•œ ํŒจํ‚ค์ง€๋ฅผ ๋‹ค์šด๋ฐ›์œผ๋ ค๋Š”๋ฐ Not found ์—๋Ÿฌ๊ฐ€ ๋œจ๋ฉด์„œ ์ •์ƒ์ ์œผ๋กœ ์ฐพ์ง€ ๋ชปํ–ˆ๋‹ค. ๊ทธ๋ž˜์„œ npm.js์— ๋“ค์–ด๊ฐ€๋ณด๋‹ˆ ํ•˜๋‹จ์˜ ์‚ฌ์ง„์ฒ˜๋Ÿผ ํŒจํ‚ค์ง€๊ฐ€ ์ •์ƒ์ ์œผ๋กœ ๋“ฑ๋ก์€ ๋˜์–ด์žˆ์—ˆ๋‹ค.

 

๊ฒฐ๊ตญ, terminal์—์„œ npm login์„ ํ•˜์ง€ ์•Š์•„์„œ ํŒจํ‚ค์ง€๋ฅผ ๋‹ค์šด๋กœ๋“œํ•˜์ง€ ๋ชปํ•œ ๊ฒƒ์ด์—ˆ๋Š”๋ฐ, ์ƒ๊ฐํ•ด๋ณด๋‹ˆ privateํ•œ ํŒจํ‚ค์ง€๋ฅผ ํ˜„์žฌ ์š”์ฒญํ•˜๋Š” ์‚ฌ์šฉ์ž์˜ ๊ถŒํ•œ์ด ์žˆ๋Š”์ง€๋„ ํ™•์ธํ•˜์ง€ ์•Š์€ ์ฑ„ ๋‹ค์šด๋กœ๋“œํ•  ์ˆ˜ ์žˆ๋‹ค๋ฉด ํŒจํ‚ค์ง€๋ฅผ private๋กœ ์„ค์ •ํ•œ๊ฒƒ์ด ๋ฌด์Šจ ์†Œ์šฉ์ด ์žˆ์„๊นŒ๋ผ๋Š” ์ƒ๊ฐ์ด ๋“ค์—ˆ๋‹ค. npm login ์ปค๋งจ๋“œ ์ž…๋ ฅ ํ›„ ์ž์‹ ์˜ npm.js๊ณ„์ •์„ ์ž…๋ ฅํ•˜๋ฉด Logged in as <id>์ปค๋งจ๋“œ๊ฐ€ ๋œจ๋Š”๋ฐ ์ •์ƒ์ ์œผ๋กœ terminal์— npm ๊ณ„์ •์ด ๋“ฑ๋ก๋œ ๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.

 

 

terminal์— ์ž์‹ ์˜ ๊ณ„์ •์ด ์„ฑ๊ณต์ ์œผ๋กœ ๋“ฑ๋ก๋๋Š”์ง€ ํ™•์ธํ•˜๋ ค๋ฉด npm whoami๋ช…๋ น์–ด๋กœ ํ™•์ธํ•˜์ž.

 

Reference

  1. https://docs.w3cub.com/npm/getting-started/installing-node.html
๋ฐ˜์‘ํ˜•

๋Œ“๊ธ€