-2

i wanted to install the vscode extension generator to try to make a extension but i cant beacause everytime i want to download a npm package it gives me this error :

npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /usr/local/lib/node_modules/generator-code
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/generator-code'
npm ERR!  [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/generator-code'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: '/usr/local/lib/node_modules/generator-code'
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: /Users/NICE/.npm/_logs/2023-08-26T17_52_23_110Z-debug-0.log
Code-Apprentice
  • 81,660
  • 23
  • 145
  • 268
  • 2
    How are you installing it? If it's a command line, use `sudo` to run as root. – Tim Roberts Aug 26 '23 at 18:03
  • It looks like you are trying to install packages in `/sur/local/lib`. Why are you installing them there and not in your user directory somewhere? – Code-Apprentice Aug 26 '23 at 18:03
  • 1
    Also, I recommend reading the entire error message. Especially the last few lines which give a hint to the solution. If you don't understand what "running npm command again as root" means, then google it. – Code-Apprentice Aug 26 '23 at 18:05

0 Answers0