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

Programming/Vue

[vue3] pnpm ์„ค์น˜ (ft. errno -13 ์˜ค๋ฅ˜)

728x90
๋ฐ˜์‘ํ˜•

pnpm ์„ค์น˜ํ•˜๊ธฐ

vue ํ”„๋กœ์ ํŠธ์˜ ํŒจํ‚ค์ง€ ๊ด€๋ฆฌ๋ฅผ npm -> pnpm์œผ๋กœ ๋ณ€๊ฒฝํ•˜๊ณ ์ž ํ•œ๋‹ค.

 

pnpm์€ npm๋ณด๋‹ค ์—ฌ๋Ÿฌ ๋ฐฉ๋ฉด์—์„œ ํ–ฅ์ƒ๋œ ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•œ๋‹ค๊ณ  ํ•œ๋‹ค.(์šฉ๋Ÿ‰, ์บ์‹œ ์šฉ๋Ÿ‰ ์ ˆ์•ฝ ๋“ฑ)

 

ํšŒ์‚ฌ์˜ ์‹ ๊ทœ ํ”„๋กœ์ ํŠธ๋„ ํŒจ์ง€ํ‚ค ๊ด€๋ฆฌ๋ฅผ pnpm์„ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๊ณ  ๊ฐœ์ธ ํ”„๋กœ์ ํŠธ๋„ pnpm์„ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์ด ์—ฌ๋Ÿฌ๋ฐฉ๋ฉด์œผ๋กœ ๋„์›€์ด ๋  ๋“ฏ ํ•˜๋‹ค.

 

๐Ÿ›  ์„ค์น˜ ์ค€๋น„๋ฌผ

pnpm์„ ์„ค์น˜ํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” Node.js์˜ ๋ฒ„์ ผ์ด 18.0 ์ด์ƒ์ด์—ฌ ํ•œ๋‹ค๊ณ  ํ•œ๋‹ค.

$ node --version

ํ„ฐ๋ฏธ๋„์—์„œ ์œ„ ๋ช…๋ น์–ด๋ฅผ ์ณ์„œ ๋…ธ๋“œ ๋ฒ„์ ผ์„ ํ™•์ธํ•˜์ž.($๋Š” ๋ช…๋ น์–ด๋ฅผ ์˜๋ฏธํ•˜๋‹ˆ $๋Š” ๋นผ๊ณ  ํƒ€์ดํ•‘ ํ•ด์ค˜์•ผํ•œ๋‹ค.)

๊ฒฐ๊ณผ๊ฐ’์ด v18.0.0 ์ด์ƒ์ด๋ผ๋ฉด ์„ค์น˜ ๊ฐ€๋Šฅํ•  ๊ฒƒ์ด๋‹ค.

 

๐Ÿ›  ์„ค์น˜ ํ•˜๊ธฐ

$ npm install -g pnpm

ํ„ฐ๋ฏธ๋„์—์„œ pmpm์„ ์„ค์น˜ํ•˜๋Š” ๋ช…๋ น์–ด๋ฅผ ์ด์šฉํ•ด์„œ ์„ค์น˜ ํ•œ๋‹ค.

>>>
added 1 package in 236ms

1 package is looking for funding
  run `npm fund` for details

์œ„์™€ ๋น„์Šทํ•œ ๊ฒฐ๊ณผ๊ฐ€ ๋‚˜์˜ค๋ฉด ์„ค์น˜๊ฐ€ ์„ฑ๊ณต๋œ ๊ฒƒ์ด๋‹ค. (>>>๋Š” ๊ฒฐ๊ณผ๋ฅผ ์˜๋ฏธํ•˜๋Š” ๊ฒƒ์œผ๋กœ ์‹ค์ œ๋กœ ๋‚˜์˜ค๋Š” ๊ฒƒ์€ ์•„๋‹˜)

 

๐Ÿ›  ์„ค์น˜ ์˜ค๋ฅ˜ ํ•ด๊ฒฐํ•˜๊ธฐ

>>>
npm ERR! code EACCES
npm ERR! syscall symlink
npm ERR! path ../lib/node_modules/pnpm/bin/pnpx.cjs
npm ERR! dest /usr/local/bin/pnpx
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, symlink '../lib/node_modules/pnpm/bin/pnpx.cjs' -> '/usr/local/bin/pnpx'

์œ„ ์ฒ˜๋Ÿผ ์„ค์น˜ ์˜ค๋ฅ˜๊ฐ€ ๋‚˜์˜ฌ ์ˆ˜ ์žˆ๋‹ค.

์„ค์น˜ ์ค‘ ์ ‘๊ทผํ•ด์•ผํ•˜๋Š” ํŒŒ์ผ์˜ ๊ถŒํ•œ์ด ์—†๋Š” ๋ฌธ์ œ์ธ๋ฐ, ๊ด€๋ฆฌ์ž ๊ถŒํ•œ์œผ๋กœ ์„ค์น˜ ๋ช…๋ น์–ด๋กœ ๋ฐ”๊ฟ”์ฃผ๋ฉด ํ•ด๊ฒฐ๋œ๋‹ค.

$ sudo npm install -g pnpm

>> Password:

๋ช…๋ น์–ด๋ฅผ ์น˜๋ฉด Password: ๋ผ๋Š” ๊ฒฐ๊ณผ๊ฐ€ ๋‚˜์˜ค๊ณ  ๋ณธ์ธ pc์˜ ๋กœ๊ทธ์ธ ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ์ณ์ฃผ๋ฉด ๋œ๋‹ค.(ํƒ€์ด๋ฐ ๊ฒฐ๊ณผ๋Š” ์›๋ž˜ ๋ณด์ด์ง€ ์•Š์œผ๋‹ˆ ๊ทธ๋ƒฅ ์ณ์ฃผ๋ฉด ๋œ๋‹ค.)

728x90
๋ฐ˜์‘ํ˜•