0
votes

I am trying to install angular cli using the command in ubuntu system.

npm install -g @angular/cli

BUt i am facing the following error: 782 verbose Linux 5.0.0-23-generic 783 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "@angular/cli" 784 verbose node v10.19.0 785 verbose npm v6.13.4 786 error code EACCES 787 error syscall access 788 error path /usr/lib/node_modules 789 error errno -13 790 error Error: EACCES: permission denied, access '/usr/lib/node_modules' 790 error { [Error: EACCES: permission denied, access '/usr/lib/node_modules'] 790 error stack: 790 error 'Error: EACCES: permission denied, access \'/usr/lib/node_modules\'', 790 error errno: -13, 790 error code: 'EACCES', 790 error syscall: 'access', 790 error path: '/usr/lib/node_modules' } 791 error The operation was rejected by your operating system. 791 error It is likely you do not have the permissions to access this file as the current user 791 error 791 error If you believe this might be a permissions issue, please double-check the 791 error permissions of the file and its containing directories, or try running 791 error the command again as root/Administrator. 792 verbose exit [ -13, true ]

Any reason why I am facing this issue?

1
sudo npm install -g @angular/cli Roberto Zvjerković
Use sudo npm install -g @angular/cli .. You should install cli with user persmission for which it shows the error as Error: EACCES: permission denied .. So you need to use sudo infront of the cli command..Maniraj Murugan
i ran it and faced another error:npm WARN deprecated [email protected]: request has been deprecated, see github.com/request/request/issues/3142 npm ERR! code EEXIST npm ERR! syscall symlink npm ERR! path ../lib/node_modules/@angular/cli/bin/ng npm ERR! dest /usr/bin/ng npm ERR! errno -17 npm ERR! EEXIST: file already exists, symlink '../lib/node_modules/@angular/cli/bin/ng' -> '/usr/bin/ng' npm ERR! File exists: /usr/bin/ng npm ERR! Remove the existing file and try again, or run npm npm ERR! with --force to overwrite files recklessly.aakriti priya
Unistall the cli globalli: npm uninstall -g @angular/cli. Clean the cache: npm cache clean --force install the cli globally again: sudo npm install -g @angular/cliJacopo Sciampi
@JacopoSciampi tried and again facing issues:deprecated [email protected]: request has been deprecated, see github.com/request/request/issues/3142 npm ERR! code EEXIST npm ERR! syscall symlink npm ERR! path ../lib/node_modules/@angular/cli/bin/ng npm ERR! dest /usr/bin/ng npm ERR! errno -17 npm ERR! EEXIST: file already exists, symlink '../lib/node_modules/@angular/cli/bin/ng' -> '/usr/bin/ng' npm ERR! File exists: /usr/bin/ng npm ERR! Remove the existing file and try again, or run npm npm ERR! with --force to overwrite files recklessly.aakriti priya

1 Answers

0
votes

Try running the Command Prompt as an administrator and then try installing angular-cli once again