DEV Community

Brylie Christopher Oxley
Brylie Christopher Oxley

Posted on • Edited on

3

Don't use "sudo" with NPM "install"

Using "sudo" when installing NPM packages may put your computer at risk, by giving untrusted code administrative privileges. Please do not use "sudo" when installing NPM packages.

Instead, use the following instructions to allow NPM to install global packages without administrative privileges:

https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally


Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (1)

Collapse
 
lirantal profile image
Liran Tal

Definitely, thanks for raising this. Using sudo is definitely an anti-pattern that may lead to security issues, as well as just mess up permissions on Unix-based operating systems.

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay