angularubuntuangular-cli

While installing 'sudo npm install -g @angular/cli ' its gives error in ubuntu


I am facing issue When I try to install Angular-CLI on ubunutu
My Node.js and npm version

  1. Node-v9.11.1
  2. npm - 5.6.0

    Command I executed
    savera9@savera9-desktop:~$ sudo npm install -g @angular/cli
    I am Getting Below Error

    npm ERR! git clone git@github.com:angular/cli Cloning into bare repository '/home/savera9/.npm/_git-remotes/git-github-com-angular-cli-515723dd'...

    npm ERR! git clone git@github.com:angular/cli Permission denied (publickey).

    npm ERR! git clone git@github.com:angular/cli fatal: Could not read from remote repository.

    npm ERR! git clone git@github.com:angular/cli

    npm ERR! git clone git@github.com:angular/cli Please make sure you have the correct access rights

    npm ERR! git clone git@github.com:angular/cli and the repository exists.

    npm ERR! addLocal Could not install angular/cli

    npm ERR! Error: ENOENT, stat 'angular/cli'

    npm ERR! If you need help, you may report this entire log,

    npm ERR! including the npm and node versions, at:

    npm ERR! http://github.com/npm/npm/issues

    npm ERR! System Linux 4.4.0-101-generic

    npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "@angular/cli"

    npm ERR! cwd /home/savera9

    npm ERR! node -v v0.10.36

    npm ERR! npm -v 1.4.28

    npm ERR! path angular/cli

    npm ERR! code ENOENT

    npm ERR! errno 34

    npm ERR!

    npm ERR! Additional logging details can be found in:

    npm ERR! /home/savera9/npm-debug.log

    npm ERR! not ok code 0


Solution

  • When I use sudo command it not worked but when I use su sudo command then it working fine.

    Introduction to Linux command 'su':-

    The Linux command 'su' is used to switch from one account to another. User will be prompted for the password of the user switching to.

    Users can also use it to switch to root account. If user types only 'su' without any option then It will be considered as root and user will be prompted to enter root user password.

    useful link :- introduction for Su command