Search code examples
linuxmacosnpmfile-permissionssudo

npm was installed using sudo?


npm was installed on my machine few months ago but I do not remember if I installed it using sudo or not.

Now, I am reading about Appian and I see that it should not be installed using sudo so I would like to check before proceeding how did I install it few months back.

How do I find out if my npm was installed with sudo or not?


Solution

  • Simply ls the executable. On my macbook it showed my username. I imagine if it was installed using sudo the permissions would be root-root:

    $ which npm
    /usr/local/bin/npm
    
    $ ls -l /usr/local/bin/npm
    lrwxr-xr-x  1 myuser  admin  38 Mar 14  2015 /usr/local/bin/npm -> ../lib/node_modules/npm/bin/npm-cli.js