(A) change owner to user for .npm folder
$ sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}
$ sudo chown -R $(whoami) ~/.npm
If above command don't resolve error
then try (b)
(B)
[1]Open terminal in your home directory
create hidden folder
$ mkdir ~/.npm-global
step 2 Optional
[2] $ npm config get prefix
[3] $ npm config set prefix '~/.npm-global'
step 4 Optional (can skip) jump to step 5
set path in profile for particular shell instance
[4] $ export PATH=~/.npm-global/bin:$PATH
[5] add into ~/.profile or ~/.bashrc
$ nano ~/.profile or $ nano ~/.bashrc
$ export PATH="~/.npm-global/bin:$PATH"
$ source ~/.profile or $ nano ~/.bashrc
To check that it works correct $ npm install -g jshint
En esta página del sitio puede ver el video en línea Node js EACCES error Ubuntu linux | Node npm global permission Ubuntu de Duración hora minuto segunda en buena calidad , que subió el usuario sevansu 15 septiembre 2020, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 10,618 veces y le gustó 66 a los espectadores. Disfruta viendo!