Development > Coding

why does npm install encounter with permission denied error on LinuxLite?


I am using LinuxLite V5 and I am trying to clone one repository from git using npm V8.3.0 but it throws this exception:

    fatal: could not create leading directories of '/root/.npm/_cacache/tmp/git-clone7tt2X1': Permission denied

I try all of these commands but no progress!!!

    npm i -g

    npm i

    sudo npm i -g

    sudo npm i

    npm install --prefix=$HOME/.local --global

    sudo npm install --prefix=$HOME/.local --global

I also run all of these commands in sudo su mode but there was not any progress.

I also checked folder owner and group and permissions. it is the result:

    drwxrwxrwx 6 root root 4096 jun 13 14:50 .npm

How can I solve this problem?


[0] Message Index

Go to full version