Error: EACCES: permission denied

Hi,

I’m running the following command
sudo npm install -g appium

This throws
Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/appium/node_modules/appium-chromedriver/...

Tried to set right permissions with
sudo chown -R '$USER' /usr/lib/node_modules/
Output
sudo chown -R '' /usr/lib/node_modules/ (empty user??)

Tried many other variants
sudo chown -R $USER:admin /usr/lib/node_modules/ (empty for USER)
sudo chown -R $USER:$GROUP /usr/lib/node_modules/ (all empty for USER and GROUP)
sudo chown -R $(id -gn $USER) /usr/lib/node_modules/ (states ‘root’)

Other configurations I tried

sudo apt-get remove -y nodejs
sudo apt-get install -y nodejs
sudo chown -R $(id -gn $USER) /usr/lib/node_modules/
sudo npm install -g appium

sudo npm install npm
sudo npm install node
sudo chown -R $(id -gn $USER) /usr/lib/node_modules/
sudo npm install -g appium

Nothing works.
Any idea?

Any help? plus more unnecessary text to reach the 10 characters…

Hi @fran.riadigos.flipsi!

Sorry for the huge delay on your report. Is the problem still persistent? If so, can you please provide us a build URL so we may able to see the details of the build where it’s occurring?