카테고리 없음

[typescript] mac에서 설치 오류 시 sudo npm install -g typescript

보리시스템 2023. 7. 17.


sudo npm install -g typescript

 

https://stackoverflow.com/questions/51116803/cant-install-typescript-on-macos-terminal-error

 

Can't install TypeScript on MacOS - Terminal Error

I have Visual Studio Code on my Mac and want to install TypeScript for Angular. I already previously installed Node.js or Git I think. This command from the TypeScript website should install TypeSc...

stackoverflow.com

 

bolees-MacBook-Pro:sia-backend bolee$ npm install -g typescript
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /usr/local/lib/node_modules/typescript
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/typescript'
npm ERR!  [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/typescript'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: '/usr/local/lib/node_modules/typescript'
npm ERR! }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/bolee/.npm/_logs/2023-07-17T03_09_45_472Z-debug-0.log
bolees-MacBook-Pro:sia-backend bolee$ sudo npm install -g typescript
Password:

added 1 package in 408ms