Installing npm package failing because of (permissions?)

Hello, im currently trying to clone a git repo for something but when executing sudo npm install on the package.json it outputs some sort of error saying this (OMmo7cW0PX | SourceBin), i have tried both executing it as the root AND adding my current user to the sudoers file (in /etc/) and none of both do anything, perhaps im miss-reading the error but to me it looks like an error saying my current user is not allowed to access something in the /root/ directory…
Thanks for your time and upcoming help

npm is not supposed to be used with sudo. You must use it as a regular user and install the packages in your home directory.

oh ok, do you have an idea what could result in this error then? because all im seeing is npm ERR! gyp WARN EACCES current user ("nobodouille") does not have permission to access the dev dir "/root/.cache/node-gyp/18.8.0"
Does this mean the package node-gyp was installed in the /root/ directory at the base of the file system? or is it the root for my particular user?

/root is the home directory of the root account, which a normal user has no access to.

Most likely, yes — see above.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.