npm install -g typescript
I ran the command above and encountered the following error message.
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! Your operating system rejected the operation.
npm ERR! You may not have the necessary permissions to access this file as the current user
npm ERR!
npm ERR! If you suspect a permissions issue, please review
npm ERR! the permissions of the file and its directories, or attempt
npm ERR! running the command again with root/Administrator privileges.
Could anyone provide guidance on how I can successfully install it?