I can not install the angular cli nor the Ionic in Linux UBuntu 16.04

2

I'm using ubuntu 16.04, it's been a while since I want to install angular cli, probe with the command

npm install -g @angular/cli

I get an error like this in the terminal:

pm WARN checkPermissions Missing write access to /home/juanse/.npm-packages/lib/node_modules/@angular/cli
npm WARN checkPermissions Missing write access to /home/juanse/.npm-packages/lib/node_modules/@angular/cli/node_modules
npm WARN checkPermissions Missing write access to /home/juanse/.npm-packages/lib/node_modules/@angular
npm ERR! path /home/juanse/.npm-packages/lib/node_modules/@angular/cli
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/home/juanse/.npm-packages/lib/node_modules/@angular/cli'
npm ERR!  { Error: EACCES: permission denied, access '/home/juanse/.npm-packages/lib/node_modules/@angular/cli'
npm ERR!   stack: 'Error: EACCES: permission denied, access \'/home/juanse/.npm-packages/lib/node_modules/@angular/cli\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/home/juanse/.npm-packages/lib/node_modules/@angular/cli' }
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 (though this is not recommended).

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/juanse/.npm/_logs/2018-06-04T16_09_24_688Z-debug.log

And for the ionic use the command:

npm install -g ionic

And I get the error:

npm WARN checkPermissions Missing write access to /home/juanse/.npm-packages/lib/node_modules/ionic npm WARN checkPermissions Missing write access to /home/juanse/.npm-packages/lib/node_modules/ionic/node_modules npm ERR! path /home/juanse/.npm-packages/lib/node_modules/ionic npm ERR! code EACCES npm ERR! errno -13 npm ERR! syscall access npm ERR! Error: EACCES: permission denied,
access '/home/juanse/.npm-packages/lib/node_modules/ionic' npm ERR! {
  Error: EACCES: permission denied, access '/home/juanse/.npm-packages/lib/node_modules/ionic' npm ERR! stack: 'Error: EACCES: permission denied, access \'/home/juanse/.npm-packages/lib/node_modules/ionic\'', npm ERR! errno: -13, npm ERR! code: 'EACCES', npm ERR! syscall: 'access', npm ERR! path: '/home/juanse/.npm-packages/lib/node_modules/ionic'
}

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 (though this is not recommended). npm ERR! A complete log of this run can be found in: npm ERR! /home/juanse/.npm/_logs/2018-06-04T16_13_38_163Z-debug.log

Help please, and investigate and tried everything but nothing manages to fix it

    
asked by Juanse Portillo 04.06.2018 в 18:16
source

2 answers

0

It's a permission problem, you should use sudo before the commands, for example:

sudo npm install -g ionic

sudo npm install -g @angular/cli

Check:

sudo apt-get install -y nodejs
sudo npm install -g @angular/cli

In case of error:

sudo npm install -g node-gyp
sudo npm install -g @angular/cli

Sudo , the only command to govern them all. It means "super user do!" Pronounced as "sue masa" As a Linux system administrator or advanced user, it is one of the most important commands in your arsenal. ... It's much better than logging in as root, or using the command "change user"

    
answered by 04.06.2018 в 18:17
0

Now I get another error to update and place everything for node now I get it:

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/@angular/cli/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
=
    
answered by 04.06.2018 в 21:36