Node Upgrade Error - Could Not Symlink

Firebase CLI๋ฅผ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” Node ์ผ์ • ๋ฒ„์ „ ์ด์ƒ์ด ํ•„์š”ํ•˜๋‹ค.

Firebase CLI v11.12.0 is incompatible with Node.js v12.14.0
Please upgrade Node.js to version ^14.18.0 || >=16.4.0

brew๋ฅผ ํ†ตํ•œ ์—…๊ทธ๋ ˆ์ด๋“œ

brew upgrade node

์ด๋ ‡๊ฒŒ ๊ฐ„๋‹จํ•˜๊ฒŒ ๋๋‚  ์ค„ ์•Œ์•˜์œผ๋‚˜,

Node.js ๋ฒ„์ „ ์ฒดํฌ

node -v

๋ฒ„์ „ ์ฒดํฌ๋ฅผ ํ•ด๋ณด๋ฉด ๊ทธ๋Œ€๋กœ๋‹ค.
์„œ์น˜ํ•ด๋ณด๋‹ˆ brew๋กœ ๊ฐ„๋‹จํ•˜๊ฒŒ link๊ฐ€ ๋œ๋‹ค๊ณ  ํ•œ๋‹ค.

์ธ์Šคํ†จํ•œ Node.js๋ฅผ ์‹œ์Šคํ…œ์— ์—ฐ๊ฒฐ

brew link --overwrite node

์ด๋ ‡๊ฒŒ ๋˜ ๊ฐ„๋‹จํ•  ์ค„ ์•Œ์•˜์œผ๋‚˜,

Write ๊ถŒํ•œ ๋ฌธ์ œ

Error: Could not symlink include/node/common.gypi

/usr/local/include/node is not writable.

๊ถŒํ•œ ๋ฌธ์ œ ๋ฐœ์ƒ.
์–ด์งธ์„ ์ง€ /usr/local/inclue๋ฅผ chown ๋ช…๋ น์–ด๋กœ ์†Œ์œ ์ž ๋ณ€๊ฒฝํ•˜์—ฌ๋„ ๋˜‘๊ฐ™์•˜๋‹ค.

brew์˜ ์†Œ์œ ์ž ๋ณ€๊ฒฝํ•˜๊ธฐ

sudo chown -R {USER_NAME} $(brew --prefix)/*
brew link node

๊ทธ๋ž˜์„œ ์•„์˜ˆ brew ๋ช…๋ น์–ด์— ์†Œ์œ ์ž ๋ณ€๊ฒฝ์„ ๊ฑธ์—ˆ๋‹ค.
* -R = Recursive : ํ•˜์œ„ ํด๋”๊นŒ์ง€ ํ•จ๊ป˜ ์†Œ์œ ์ž ๋ณ€๊ฒฝ

์ตœ์‹  ๋ฒ„์ „์˜ Node.js๊ฐ€ ์„ฑ๊ณต์ ์œผ๋กœ link๋˜์—ˆ๋‹ค.

์†Œ์œ ๊ถŒ์„ ์—ฌ๊ธฐ์ €๊ธฐ ๋ฟŒ๋ฆฌ๋Š” ๊ฒƒ์€ ๋ณด์•ˆ์ ์œผ๋กœ ์ข‹์€ ๋ฐฉ๋ฒ•์€ ์•„๋‹ˆ๊ฒ ์œผ๋‚˜ brew๋ฅผ ์“ฐ๋Š” ์ด์ƒ ๊ฐ์ˆ˜ํ• ๋งŒํ•˜๋‹ค๊ณ  ์ƒ๊ฐ๋œ๋‹ค.

Good Luck.