Does anyone know what's the difference between sudo npm install -g npm and sudo apt-get install npm?


The latter technically depends on your distribution. But chances are its an DEB package that installs npm including installing its dependence like nodejs and would be a full install like documentation and binaries not just javascript module.

The former installs a global scoped npm module along with its dependencies using the latter npm. This could theoretically replace the same module that the DEB installed but chances are certainly that this is not the case. Instead its npm module that exists as a managed package of the system npm probable in /usr/local/share/npm instead of /usr/share/npm.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.