When should I use `sudo` for `npm install -g cordova`? -


i'm looking through phonegap / cordova cli documentation http://docs.phonegap.com/en/3.4.0/guide_cli_index.md.html#the%20command-line%20interface , recommends installing cordova cli sudo

    $ sudo npm install -g cordova 

however linux co-workers have kicked *ss using sudo willy nilly, need when installing package or able continue normal cordova cli use without it?

thanks, danc

the cordova package meant used command line utility, rather module require('cordova') in other node.js code. -g (or global install) option install cordova module @ location specified npm's prefix config setting:

the prefix config defaults location node installed. on systems, /usr/local

you can view current value of setting npm config prefix.

typically, using global install option add shell scripts global module, cordova script, location visible shell's search $path. enables execute commands cordova create foo without specifying path cordova shell script.

i suspect prefix path other /usr/local, or user account must have write privileges prefix folder. typical setups don't grant write privileges /usr/local regular users, need sudo. prefer use sudo install things on granting write access /usr/local regular users.


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -