Can't install ipfs with npm

When I do on my Manjaro Deepin Linux x64:
# npm i ipfs --global
I get

npm ERR! code 128
npm ERR! Command failed: /usr/bin/git clone --depth=1 -q -b master git:// /root/.npm/_cacache/tmp/git-clone-e9adc753
npm ERR! fatal: não foi possível criar os diretórios superiores de '/root/.npm/_cacache/tmp/git-clone-e9adc753': Permission denied
npm ERR! 

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2017-08-22T13_36_21_135Z-debug.log

Hi alexandre i think you need to add ‘sudo’ before your command

I’m executing the command as a root user @josselinchevalay .
Can someone help?

Thank you. It did solve my problem.
But the weird thing is that in the past I could install globally without a problem on this pc; itonly gave problems in the ipfs npm package