Urgent.News

What's breaking now, across thousands of outlets.

Tech

Your npm install Is Doing More Than You Think

Most developers type: npm install and think: “npm is downloading my dependencies.” That's only part of the story. Depending on your project and dependencies, an install can involve dependency resolution, lockfile processing, lifecycle scripts, native builds, transitive dependencies, and executable code. And that's why npm install deserves more attention than it usually gets. 1. npm install…

The npm install command does more than simply downloading packages. When you type `npm install`, npm performs several actions behind the scenes. These include resolving dependency versions, reading or updating a lockfile, downloading packages, installing dependencies, resolving transitive dependencies, running lifecycle scripts, and potentially building native dependencies. So, `npm install` is closer to "Resolve → Download → Install → Execute lifecycle scripts → Build where necessary" than just "Download files."

Your dependencies are not just the packages you explicitly install. They also include all the packages those dependencies depend on, which are called transitive dependencies. For example, when you install one package, you might end up installing dozens or hundreds of packages indirectly. These transitive dependencies form a trust chain because they can potentially compromise your application, even if you never looked at their source code.

Lifecycle scripts defined in the package.json file are also executed during installation. For instance, a package might define a `postinstall` script to run `node setup.js`. This means that an installation can involve executing code, not just copying JavaScript files into the `node_modules` directory.

While lifecycle scripts can be useful for tasks like compiling native components or generating files, they should not be taken lightly from a security perspective. Installing a dependency can result in code execution during installation, which could lead to security vulnerabilities if the code is malicious.

Although lifecycle scripts are not inherently dangerous, they raise the importance of understanding what code you are trusting when you install a package. Not all npm scripts are malicious, but executing code from your dependency chain requires a more accurate security mindset.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Node.js Password Reset Request in 2026: Confirm Tokens, Expiry, Email, and Audit Logs

A Node.js password reset request should issue a server-side token, email its link, confirm it separately, write an audit log, and revoke existing sessions; otherwise, a gaming account can change its…

  • Node.js password reset uses server-side token and email link
  • Confirm token separately before updating audit log
  • Revoking sessions prevents unauthorized inventory exploitation

The Foundation: The Open-Source Stack Behind a Home SOC

Part 1 of a series on building an enterprise-grade Security Operations Center at home. Start with Part 0 if you haven't. In Part 0 I made a claim: you can build a real, operating Security Operations…

  • SOC built with Suricata, Zeek, Wazuh, ntopng, and Elasticsearch
  • Each tool has distinct function: detection, logging, monitoring, visibility, data layer
  • Network segmentation recommended via VLANs to limit damage from compromised devices

What Improves Developer Productivity at Google? Code Quality

Abstract: Understanding what affects software developer productivity can help organizations choose wise investments in their technical and social environment.

  • Code quality directly impacts developer productivity at Google.
  • Technical debt and infrastructure tools support also influence productivity.
  • Effective team communication and aligned goals further boost productivity.

More from Sunday 27 September →