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.

Sentry blog image

How I fixed 20 seconds of lag for every user in just 20 minutes.

Our AI agent was running 10-20 seconds slower than it should, impacting both our own developers and our early adopters. See how I used Sentry Profiling to fix it in record time.

Read 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.