3

estoy usando ubuntu 16.04, hace tiempo que ya quiero instalar angular cli, probe con el comando

npm install -g @angular/cli

Me sale en la terminal un error asi:

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

Y para el ionic uso el comando:

npm install -g ionic

Y me sale el 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

Ayuda por favor, e investiga y probado de todo pero nada logra arreglarlo

1 respuesta 1

1

Es un problema de permiso, debe usar sudo antes de los comandos, por ejemplo:

sudo npm install -g ionic

sudo npm install -g @angular/cli

Check:

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

En caso de error:

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

Sudo, el único comando para gobernarlos a todos. Significa "super usuario do!" Pronunciado como "sue masa" Como administrador de sistemas Linux o usuario avanzado, es uno de los comandos más importantes en su arsenal. ... Es mucho mejor que iniciar sesión como root, o usar el comando su "cambiar usuario"

8
  • AHora me sale asi [/home/juanse/.npm-packages/bin/ng -> /home/juanse/.npm-packages/lib/node_modules/@angular/cli/bin/ng > @angular/[email protected] postinstall /home/juanse/.npm-packages/lib/node_modules/@angular/cli > node ./bin/ng-update-message.js 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"}) + @angular/[email protected] updated 1 package in 25.08s ] Commented el 4 jun. 2018 a las 16:26
  • sudo npm install -g ionic cordova Commented el 4 jun. 2018 a las 16:27
  • @JuansePortillo actualizado mi respuesta Commented el 4 jun. 2018 a las 16:29
  • Me sale lo mismo Commented el 4 jun. 2018 a las 16:31
  • ejecuta npm -v y dime qué versión tienes Commented el 4 jun. 2018 a las 16:32

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge you have read our privacy policy.

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.