Fact-checked by Grok 2 weeks ago

npm

npm is a package manager for the JavaScript programming language and the default tool for managing dependencies in the Node.js runtime environment. It enables developers to install, share, and reuse open-source code packages from a centralized registry, which as of 2025 hosts over 2.5 million packages, making it the world's largest software repository. Originally released in 2010 by Isaac Z. Schlueter as an open-source project to facilitate modular code sharing for Node.js, npm has become integral to JavaScript development workflows, supporting both server-side and client-side applications through command-line operations defined in a package.json manifest file. Developed initially to address the lack of standardized module sharing in early ecosystems, npm introduced semantic versioning and dependency resolution mechanisms that promoted reusable components over monolithic codebases. Its adoption exploded alongside , powering much of modern by allowing rapid prototyping and integration of libraries for tasks ranging from HTTP servers to data processing. However, npm's reliance on unvetted third-party contributions has led to significant vulnerabilities, including supply-chain attacks where malicious code is injected into popular packages, affecting millions of downloads weekly. A defining controversy occurred in 2016 with the unpublishing of the left-pad utility package, a 17-year-old maintainer's decision to remove his 11-line module due to a naming dispute, which cascaded to break builds across the ecosystem since thousands of projects depended on it indirectly. In response, —the commercial entity formed around the tool and later acquired by —implemented policies restricting package removals to prevent such disruptions, underscoring the tension between maintainer autonomy and ecosystem stability. Despite these challenges, npm's CLI tool remains bundled with installations, ensuring its dominance while alternatives like and pnpm address performance critiques through innovations in caching and deduplication.

Core Functionality and Features

Package Installation and Management

The npm install command serves as the primary mechanism for installing packages, downloading the specified package from the npm registry along with its recursive dependencies into the project's node_modules directory. By default, installations are local to the current project directory, enabling modular dependency management without affecting other projects or the global environment. Running npm install without arguments reads the dependencies and devDependencies sections from and installs all listed packages, ensuring consistent setup across environments. To add a new package, developers execute npm install <package-name>, which not only installs the package but also automatically appends it to the dependencies field in package.json (since npm version 5.0.0, released in 2017). For development-only dependencies, the --save-dev or -D flag is used, adding the entry to devDependencies instead. Global installations, intended for command-line tools or utilities shared across projects, require the -g flag, such as npm install -g <package-name>, placing binaries in a system-wide directory like /usr/local/bin on systems. This distinction prevents version conflicts but necessitates caution with global packages due to potential and issues from unvetted system-wide access. Package management extends to removal and updates: npm uninstall <package-name> deletes the package from node_modules and removes its entry from package.json, while npm update upgrades packages to the latest compatible versions within semver constraints defined in package.json. These operations maintain project integrity by preserving dependency trees, though updates can introduce breaking changes if not bounded by version specifiers like caret (^) or tilde (~) prefixes. For reproducibility, installations generate or respect package-lock.json, locking exact versions resolved during the process.
npm install express  # Installs express locally and adds to dependencies
npm install -g nodemon  # Global install for development server
npm uninstall lodash  # Removes lodash and updates package.json
Best practices emphasize auditing dependencies post-installation via npm audit to detect vulnerabilities, as the open nature of the registry exposes projects to risks from unmaintained or malicious packages. Developers should verify package provenance, favoring those with active maintenance and high download counts, given historical incidents of supply-chain attacks in the ecosystem.

Dependency Resolution and Lockfiles

npm resolves dependencies by parsing the semver ranges in a project's package.json and recursively installing packages from the npm registry, constructing a dependency tree within the node_modules directory. Primary dependencies listed in package.json are placed at the root level, while their subdependencies are installed in nested node_modules subdirectories unless hoisted. This process prioritizes the highest version satisfying all specified ranges without a full constraint-solving , potentially allowing multiple versions of the same package if conflicts arise from incompatible ranges. Beginning with version 3.0.0 in 2015, npm introduced a hoisting mechanism to flatten the dependency tree, reducing redundancy and nesting by elevating compatible dependencies to the highest possible level in the tree where their version satisfies requirers from multiple packages. Hoisting occurs post-resolution during installation: npm scans the tree and moves packages upward if no version conflicts exist, but retains nesting for packages requiring specific incompatible versions to avoid breaking dependents. This flattening improves performance and disk usage but can introduce peer dependency issues if not all consumers are considered. The package-lock.json file addresses variability in resolution by locking the exact dependency tree. Introduced in npm 5.0.0 on May 25, 2017, it automatically generates during npm install or updates, recording precise versions, resolved structure, and SHA-512 integrity hashes for every package and transitive dependency. Unlike package.json, which uses flexible ranges (e.g., ^1.0.0), the lockfile specifies fixed versions (e.g., 1.0.1) to guarantee identical installations across environments, preventing drift from registry updates within ranges. Committing package-lock.json to version control is standard practice for reproducibility in teams and CI/CD pipelines, enabling "time-travel" to prior states via diffs and optimizing subsequent installs by reusing resolved metadata. The file's format evolves with npm versions, denoted by lockfileVersion: 1 for npm 5–6, 2 for 7–8, and 3 for 9 and later, with backward compatibility for older files during upgrades. Commands like npm ci enforce strict adherence to the lockfile without modifications, while npm install updates it if dependencies change; deleting it forces fresh resolution. Prior to lockfiles, npm-shrinkwrap.json served a similar but manual role, now superseded.

Publishing and Versioning

Packages in npm follow the Semantic Versioning (SemVer) 2.0.0 specification, which structures version numbers as MAJOR.MINOR.PATCH (e.g., 1.2.3). In this scheme, MAJOR increments for incompatible changes, MINOR for backwards-compatible feature additions, and PATCH for backwards-compatible bug fixes; pre-release versions append identifiers like -alpha.1, and build metadata uses + (e.g., 1.0.0-alpha+001). npm enforces unique versions per package name across the registry, preventing republishing of identical versions to maintain integrity. To update a package's before publishing, developers run the npm version command, which modifies the version field in package.json, creates a commit and tag with the new , and optionally pushes changes. Available update types include major, minor, patch, premajor, preminor, prepatch, and prerelease, defaulting to patch if unspecified; this automates adherence to SemVer rules while integrating with . The package.json file requires a valid SemVer-compliant version field for any package intended for publication. Publishing occurs via the npm publish command, which bundles specified files from the package directory—excluding those in .npmignore or .gitignore by default—and uploads them to the registry (public by default at registry.npmjs.org). Authentication requires an account via npm login, with scoped packages (prefixed like @scope/name) supporting public or private visibility based on account settings. The process includes running prepublishOnly and publish scripts from package.json if defined, allowing custom preparation like building or testing. Upon success, the package becomes installable via npm install <name>, resolving to the highest matching the requested (e.g., ^1.2.3 allows 1.x.x updates but not 2.0.0). npm supports distribution tags (dist-tags) to alias versions, such as latest (default for installations without specifiers) or custom tags like next for beta releases; these are managed with npm dist-tag commands and do not alter the underlying SemVer but guide consumer resolution. For reproducibility, package-lock.json locks exact versions during dependency resolution, though publishing focuses on the top-level package's metadata and tarball. Violations of SemVer in practice can lead to dependency breakage, as evidenced by historical incidents like the 2016 left-pad removal, which underscored the registry's version immutability.

Architecture and Registry

The npm Registry Structure

The npm registry operates as a centralized database of packages, where each package comprises executable software bundled in a gzipped tar archive (.tgz file) alongside JSON-formatted metadata detailing attributes such as dependencies, versions, authors, and licensing. This structure enables efficient distribution and resolution of over 2 million unique packages as of recent counts, serving as the default repository at https://registry.npmjs.org. Metadata for a given package is exposed through a RESTful endpoint via GET /<package-name>, returning a comprehensive document that includes fields like name (the package identifier), versions (an object mapping semantic version strings to version-specific metadata, such as dist.tarball URLs pointing to the archive), dist-tags (for aliasing versions like "latest"), maintainers, license, and timestamps for creation and modification. Scoped packages, prefixed with @scope/, are URL-encoded in requests (e.g., @scope%2Fpackage) to maintain isolation for organizations. An abbreviated metadata variant, requested with the Accept: application/vnd.npm.install-v1+json header, omits extraneous fields to optimize installation workflows by npm install. Underlying storage separates metadata from binaries: CouchDB historically managed both, but since February 2014, tarball attachments were migrated to Joyent's to address scaling limitations with over 250,000 package versions, while metadata persists in lightweight replicas like SkimDB (attachment-free for faster replication) or FullfatDB (with reattached tarballs for complete mirrors). The registry adheres to the Package Registry specification for read operations, allowing npm to resolve packages by name and version, and supports write APIs for publishing (PUT with tarball and metadata), unpublishing (limited to within 24 hours on the public registry), and . Replication endpoints, such as https://skimdb.npmjs.com/registry, facilitate read-only mirrors to distribute load and enable private proxies or enterprise caching.

Scoped Packages and Organizations

Scoped packages in npm utilize a namespacing convention with the prefix @scope/, followed by the package name, enabling developers to publish packages without name collisions that affect unscoped packages. This mechanism groups related packages under a common , which is owned by either an individual npm user account or an , and supports both public and private visibility. Scoped packages are installed via commands like npm install @scope/package, and required in code as require('@scope/package'), with dependencies on scoped packages functioning identically to unscoped ones. Support for publishing and installing scoped packages was introduced in npm version 2.0.0, released on September 22, 2014, as part of enhancements to handle needs for modules while maintaining with the registry. Prior to this, package naming was limited to global uniqueness, leading to frequent conflicts as the registry grew beyond 350,000 packages by early 2017. Scopes also facilitate : scoped packages are freely installable, while ones require tied to the owning . Organizations in npm extend scoped functionality for collaborative management, allowing multiple users to share ownership of a for publishing, maintaining, and accessing packages. Created by any npm user, organizations function as paid or free entities—free for packages only, with billing for package storage and features beyond basic limits. They enable fine-grained permissions, such as designating members as owners, admins, or collaborators, who can then publish under the organization's (e.g., @myorg/utils). This structure supports workflows, including two-factor enforcement and package-level access revocation, addressing scalability issues in large development s. As of October 2023, organizations remain integral for adoption, integrating with npm's registry to mirror user scopes but with enhanced .

Caching and Offline Support

npm employs a caching system to store downloaded packages and , reducing redundant requests and accelerating subsequent installations. The cache utilizes a mechanism implemented via the _cacache within the configured cache path, ensuring efficient retrieval based on package integrity hashes. By default, the cache is located at ~/.npm on systems (e.g., , macOS) and %LocalAppData%\npm-cache on Windows. Users can view or modify the cache location using npm config get cache or npm config set cache <path>. Cache management commands include npm cache verify, which checks for corruption by validating package integrity against the registry, and npm cache clean --force, which removes all cached data to free disk space or resolve issues. During npm install, the CLI preferentially consults the before fetching from the registry, storing new tarballs and for future use; this behavior can be tuned via flags like cache-lock-stale for handling stalled locks. The supports scoped packages and registries equivalently, maintaining separation by registry URL to avoid cross-contamination. For offline support, npm provides the --offline flag, which enforces installation without any network access, relying exclusively on cached packages and lockfiles like package-lock.json for dependency resolution. This mode fails if required packages are absent from the cache, making it suitable for air-gapped environments or when network connectivity is unavailable. Complementarily, --prefer-offline prioritizes cache contents over remote fetches but permits network requests to supplement missing data, balancing reliability with offline resilience. In continuous integration or deployment pipelines, combining lockfiles with pre-warmed caches—populated via prior online installs—enables without registry dependency. These features, introduced in early npm versions and refined over time, mitigate constraints and enhance determinism, though cache corruption necessitates periodic verification to prevent failures.

Historical Development

Origins with Node.js (2009–2010)

, a runtime built on Chrome's , was developed by in early 2009 to enable server-side execution with an event-driven, non-blocking I/O model. As Node.js gained initial traction, developers faced challenges in sharing and managing reusable code modules, lacking a centralized system for dependency installation and distribution. To address this, Isaac Z. Schlueter initiated development of , originally standing for Node Packaged Modules, in September 2009 as an open-source project written in . An early preview version of npm appeared on October 1, 2009, allowing basic package management for applications. The first stable release of npm occurred on January 12, 2010, marking its integration as the default for and enabling developers to install, share, and version libraries via a . This foundational tool facilitated the rapid growth of the ecosystem by standardizing dependency resolution and promoting modular . By the end of 2010, npm had laid the groundwork for what would become the world's largest software registry, though it remained tightly coupled with installations during this period.

Growth and Key Milestones (2011–2019)

npm 1.0 was released on May 1, 2011, establishing a stable foundation for package management with consistent local installations and a focus on serving as a development tool rather than a system-wide package handler. This version aligned npm closely with workflows, enabling and centralized dependency resolution via the emerging public registry. By September 2014, the registry hosted approximately 94,767 packages, reflecting rapid adoption driven by Node.js's server-side expansion. npm 2.0.0 launched on September 22, 2014, introducing deterministic installation through shrinkwrap files and improved handling of peer dependencies to reduce conflicts in complex projects. Weekly downloads reached about 50 million packages that year, underscoring npm's role in accelerating ecosystem productivity. npm 3.0 arrived in June 2015, featuring a rewritten installer for better Windows compatibility and a flatter to mitigate deeply nested node_modules bloat. Growth accelerated, with the registry surpassing 100,000 packages shortly thereafter amid surging usage in web applications and . In May 2017, npm 5.0.0 delivered significant performance gains via scoped package optimizations and introduced npx for executing packages without global installation, streamlining one-off tool usage. npm 6.0 followed on April 24, 2018, adding built-in security auditing with the npm audit command to detect vulnerabilities in dependencies. By mid-2019, the registry hit the 1 million package on , with weekly downloads climbing to 10.9 billion and monthly figures at 46.9 billion, evidencing npm's dominance in open-source distribution despite occasional critiques of registry scale introducing maintenance overhead. This period's —packages increasing over tenfold from 2014 levels—paralleled Node.js's maturation but highlighted emerging challenges like bloat and risks from unvetted uploads.

Corporate Ownership and Modern Era (2020–Present)

In March 2020, GitHub announced an agreement to acquire npm, Inc., the company behind the npm package manager and registry, for an undisclosed amount. The deal, which closed on April 15, 2020, positioned npm as a subsidiary of GitHub, itself owned by Microsoft since 2018, aiming to enhance the reliability and security of JavaScript package distribution while maintaining the public registry's free access for developers. Post-acquisition, npm, Inc. continued operations independently but benefited from GitHub's resources, including improved infrastructure for handling over 2 million packages and billions of downloads weekly as of 2020. Under GitHub's ownership, npm introduced enterprise-focused enhancements, such as advanced authentication and audit logging in paid plans, while the core CLI and public registry remained open-source and free. Key CLI updates included npm version 7 in October 2020, which automated peer dependency installations and added workspace support for monorepos, reducing common installation errors. Subsequent releases—npm 8 in 2021 with overrides for dependency patching, npm 9 in 2022 emphasizing security scans, and npm 10 in 2023 with faster caching—reflected a corporate emphasis on and mitigation, aligning with GitHub's tools like Actions for automated publishing. From 2023 to 2025, npm's modern era saw deeper integrations with , including streamlined package publishing via GitHub Packages and enhanced features like attestations to verify package authenticity. In response to rising attacks, npm implemented stricter policies, such as requiring two-factor for publishers and scanning for malicious code, culminating in October 2025 updates limiting lifetimes to 90 days maximum and restricting TOTP 2FA usage to prevent hijacking. These changes, driven by 's oversight, addressed criticisms of prior vulnerabilities but drew some developer feedback on increased friction for legacy workflows, though adoption remained high with npm retaining dominance in the ecosystem hosting over 3 million packages by 2025.

Security Model and Vulnerabilities

Built-in Security Tools

npm incorporates the audit command as its core built-in mechanism for detecting security vulnerabilities in project dependencies. This tool submits a snapshot of the installed package tree to the npm registry, which cross-references it against a database of published advisories to generate a report detailing affected packages, vulnerability severity (categorized as high, moderate, or low), and remediation paths through the . Introduced in npm version 5.5.0 on May 8, 2018, npm audit runs automatically during npm install operations (configurable via the audit flag or .npmrc settings like audit-level), providing immediate feedback on known issues without requiring external scanners. The report includes metadata such as (CVE) identifiers where available, exploitability assessments, and suggested fixes, drawing from advisories submitted by package maintainers or security researchers to the npm security team. Complementing detection, the npm audit fix subcommand attempts automated remediation by updating vulnerable dependencies to patched versions that satisfy the project's semantic versioning constraints in package.json, preserving compatibility where possible; a --force option allows breaking updates but risks instability. Recent enhancements include audit report signatures for integrity verification, ensuring the response has not been tampered with during transit from the registry. These tools rely on the npm registry's centralized advisory system, which as of October 2023 processes audits for millions of daily scans but is limited to disclosed vulnerabilities, potentially overlooking undisclosed or rapidly evolving threats until advisories are published. options, such as disabling audits via npm install --no-audit or customizing output with formatting (npm audit --json), enable integration into pipelines for enforced security gates.

Common Attack Vectors

One primary attack vector involves the compromise of maintainer accounts, often through phishing or credential theft, allowing attackers to publish malicious versions of legitimate packages. In September 2025, threat actors compromised accounts associated with 18 popular npm packages, including debug, chalk, and ansi-styles, injecting obfuscated payloads that enabled cryptocurrency wallet hijacking and affected over 2.6 billion weekly downloads. This method exploits npm's trust model, where verified publishers can update packages without mandatory code review, facilitating supply chain propagation to downstream dependents. Typosquatting represents another prevalent vector, wherein attackers register packages with names resembling popular ones to deceive developers into installing malware. For instance, malicious packages mimicking typescript-eslint and @types/node were downloaded thousands of times in late 2024, delivering credential-stealing payloads. Variants include case-insensitive impersonation using lowercase letters or dependency confusion, where internal packages are overshadowed by public malicious equivalents; npm's detection blocks overt typosquats but struggles with subtle variants. Direct publication of malicious packages targets niche audiences, such as those using tools, by mimicking scoped names like @azure/* to inject backdoors or data exfiltrators. In Q1 2025 alone, Sonatype identified nearly 18,000 new malicious open-source packages across registries, with comprising a significant portion due to its scale. Self-propagating worms, like the Shai-Hulud attack in September 2025, compromise packages to harvest credentials and infect others automatically, affecting over 100 libraries with data-stealing . Additional vectors include on expired or unmaintained packages and injecting via transitive , amplifying risks in unvetted dependency trees. These exploits underscore npm's vulnerability to unverified uploads, with over 70 malicious packages and extensions detected in mid-2025 stealing developer credentials and crypto assets.

Mitigation Strategies and Best Practices

To mitigate vulnerabilities in npm ecosystems, developers should prioritize built-in auditing tools to identify and remediate known security issues in dependencies. The npm audit command, available since npm version 6, scans package-lock.json against the npm security database, reporting vulnerabilities by severity, affected paths, and suggested fixes; it runs automatically during npm install but can be invoked standalone or integrated into CI/CD pipelines for ongoing monitoring. For automatic remediation, npm audit fix updates compatible dependencies to patched versions, though manual review is advised for breaking changes, and npm audit fix --force handles major version updates at potential risk to compatibility. Enforcing reproducible installations prevents dependency drift and substitution attacks by committing package-lock.json to version control and using npm ci instead of npm install in production or CI environments, which strictly installs from the lockfile without modifications. This practice counters threats like malicious updates or typosquatting, where attackers register similar package names; npm blocks detected typosquats and encourages scoped packages (e.g., @organization/package) to namespace dependencies and reduce confusion risks. Controlling lifecycle scripts mitigates risks from malicious post-install or pre-publish hooks in untrusted packages, which could execute arbitrary code. Install with the --ignore-scripts flag or set ignore-scripts=true in .npmrc to disable them by default, then selectively allow trusted scripts using tools like @lavamoat/allow-scripts for an allowlist-based approach. Account security practices are essential to prevent credential compromise enabling package hijacking. Enable two-factor authentication (2FA) via authenticator apps or security keys on npm accounts, mandatory for maintainers of high-impact packages (over 1 million weekly downloads or 500+ dependents) as of 2024, with one-time email verification for others during sensitive actions. Use read-only or scoped authentication tokens generated via npm token create instead of passwords for automation, revoking them promptly after use. For supply chain integrity, vet packages by checking metadata with npm info, maintainer activity, download statistics, and health via npm outdated or npm doctor; minimize transitive dependencies and generate software bills of materials (SBOMs) using tools like CycloneDX for traceability. Organizations should deploy private proxies like Verdaccio for artifact governance, implement trusted publishing with for short-lived credentials, and monitor for malicious content by reporting suspicious packages to support. These layered defenses, combined with regular dependency pruning and peer-reviewed updates, reduce exposure without eliminating inherent risks from third-party code.

Major Incidents and Controversies

left-pad Unpublishing Crisis (2016)

On March 22, 2016, developer Azer Koçulu unpublished the left-pad package—a 11-line JavaScript utility for left-padding strings—from the npm registry, triggering widespread build failures across JavaScript projects. The package, which had been downloaded over 69,000 times in the prior week, served as a transitive dependency for thousands of modules, including major tools like Babel and React, exposing the ecosystem's reliance on unvetted, single-maintainer utilities. Fresh npm install commands failed with errors indicating the package's absence, halting automated builds and deployments for developers worldwide, as npm versions prior to 3.0 lacked robust caching to mitigate such removals. The unpublishing stemmed from Koçulu's dispute with messaging company Kik over the unrelated kik package, which Koçulu had authored as a Node.js library for the Kik API; Kik invoked its trademark to claim the name, prompting npm to transfer ownership to the company per its dispute resolution policy, after which Koçulu deleted over a dozen of his packages in protest. Koçulu had emailed npm support expressing frustration with the decision, arguing it undermined open-source principles, though the left-pad removal was not directly tied to the kik conflict. The MIT-licensed code of left-pad permitted republishing, but the incident underscored risks in npm's model, where maintainers retain unilateral deletion rights without mandatory backups or version locks in all tools. In response, npm CTO Laurie Voss manually republished left-pad version 0.0.3 under the npm organization's account to restore functionality, an "unprecedented" justified by the package's systemic impact. npm's official clarified that the was not "stolen" but openly licensed, while announcing technical and policy reforms to curb future disruptions, including restrictions on unpublishing packages published over 24 hours prior or those with significant download histories. By March 30, 2016, npm formalized these changes, prohibiting deletions of semantic versions to prioritize over individual maintainer control. The crisis amplified criticisms of npm's dependency culture, where trivial, forkable functions like left-pad—implementable in minutes—propagated through vast dependency trees, revealing single points of failure in supply chains lacking enforced redundancy or auditing. It prompted community forks, such as leftpad by itself, and broader adoption of lockfiles and caching in tools like npm 3+, though it did not immediately resolve underlying issues of maintainer abandonment or policy enforcement. The event, while resolved within hours, highlighted causal vulnerabilities in decentralized registries reliant on voluntary maintenance, influencing subsequent security practices like scoped packages and provenance tracking.

Malicious Dependency Injections (2018–2022)

In November 2018, the widely used event-stream package, a stream transformation utility downloaded millions of times, became the vector for a compromise when its original maintainer transferred control to a new developer unable to commit time to maintenance. Starting with 4.0.0 released in August 2018, the new maintainer introduced a on flatmap-stream 0.1.1, which embedded code designed to extract mnemonic seeds from Copay wallets present in the runtime environment, potentially enabling theft of funds. The malicious code evaded detection for months, accumulating approximately 8 million downloads of affected versions before a developer auditing a build warning identified it on November 26, 2018; npm's security team promptly scoped and notified affected parties, leading to the package's reversion to a safe state. This incident exemplified risks from maintainer handovers in open-source ecosystems, where unvetted successors could inject subtle dependencies without rigorous , as event-stream lacked formal governance or automated scanning at the time. The attack targeted a niche in specific software rather than broad exploitation, but it prompted to enhance auditing processes and encouraged community adoption of tools like dependency pinning and integrity checks. No widespread financial losses were publicly reported, though the episode eroded trust in transitive dependencies, with downstream projects like those using event-stream in build pipelines facing potential exposure if not updated promptly. A similar account hijacking occurred in October 2021 with ua-parser-js, a user-agent library averaging over 7 million weekly downloads for browser and device detection in web applications. Attackers compromised the maintainer's npm credentials, publishing malicious versions 0.7.29, 0.8.0, and 1.0.0 on October 22, 2021, which included obfuscated payloads to deploy a cryptominer via a remote script and exfiltrate environment variables, system credentials, and network details to attacker-controlled servers. The tainted releases persisted online for roughly four hours before detection and removal by the maintainer and npm, limiting direct infections but affecting automated dependency resolution in pipelines during that window. The ua-parser-js breach highlighted persistent weaknesses in npm account security, such as inadequate two-factor enforcement prior to npm's 2022 mandate, allowing or to enable rapid publication of trojanized updates. Security firms noted the malware's modular design, combining immediate payload execution with data harvesting for lateral movement, though impacts were contained by swift revocation and no evidence of mass propagation beyond initial installs. This event spurred recommendations for runtime integrity verification and scoped package audits, with organizations like CISA urging pinning to verified versions and monitoring for anomalous publishes. Between these high-profile cases, npm saw sporadic malicious injections via compromised maintainer accounts or dependency swaps, though comprehensive data on lesser incidents remains fragmented due to underreporting in decentralized repositories. For instance, isolated reports emerged of credential-targeted payloads in lesser-known packages during 2019–2020, often leveraging unmaintained libraries for cryptocurrency mining or , but none scaled to the download volumes of event-stream or ua-parser-js. These attacks collectively drove ecosystem-wide shifts toward scoped npm tokens, audit logs, and third-party scanners, revealing how reliance on unverified updates amplified risks in JavaScript's hyper-connected .

Large-Scale Supply Chain Attacks (2023–2025)

In 2025, the npm ecosystem experienced two major attacks that compromised numerous packages and exposed vulnerabilities in maintainer account security and dependency propagation. The first, dubbed "s1ngularity," targeted the Nx tool in late August, exploiting Actions workflows to publish malicious versions of Nx packages. Attackers weaponized prompts directed at local large language models (LLMs) integrated into developer environments, tricking them into exfiltrating credentials and secrets. This incident highlighted risks from -assisted tools, as the malware prompted LLMs like Gemini or Claude to bypass safeguards and steal tokens, affecting organizations using Nx for build orchestration. Nx maintainers responded by revoking compromised tokens, scanning repositories, and enhancing workflow validations, though the attack's scale was limited to Nx-specific dependencies. The second and more widespread attack, involving the self-replicating "Shai-Hulud" worm, began on September 8, 2025, when emails disguised as s compromised maintainer accounts, including that of developer for packages like and debug. Attackers injected obfuscated payloads into at least 18 popular packages—such as (used for terminal styling), debug (for logging), and ansi-styles—with these alone accounting for over 2.6 billion weekly downloads. The stole publish tokens, hijacked transactions via wallet integrations, and propagated by scanning for vulnerable dependencies, ultimately compromising over 700 packages and prompting the removal of more than 500 from the registry. CISA issued an on September 23, 2025, urging credential rotation and pinning to pre-September 16 versions, noting the attack's potential to enable further credential theft and pipeline infiltration. These incidents underscored systemic issues in npm's trust model, where account takeovers via —often exploiting weak 2FA or reset processes—allow rapid dissemination of malicious updates without . Prior years (2023–2024) saw fewer documented large-scale compromises, though attack volumes rose significantly, with incidents increasing 742% from 2019 to 2023 per industry reports. npm responded by blocking attacker IPs, enforcing stricter token scopes, and planning mandatory enhancements, but critics noted delays in detecting propagation due to reliance on community reporting. The events affected billions of potential installations, prompting recommendations for scanning, dependency locking, and avoidance of unverified maintainer privileges.

Ecosystem Impact and Criticisms

Acceleration of JavaScript Development

npm's package registry and dependency management capabilities, introduced alongside on January 12, 2010, enabled developers to install and integrate reusable modules via simple command-line operations, markedly reducing the time required to implement routine functionalities such as HTTP handling, data parsing, and . This addressed prior limitations in , where the absence of a standardized system often resulted in manual code duplication or reliance on cumbersome browser-based inclusions, slowing project initiation and iteration. The ecosystem's expansion, reaching over 2.5 million live packages by the end of with billions of annual downloads, provided an extensive repository of vetted solutions, allowing teams to compose applications from specialized components rather than building from foundational elements. Developers reported substantial gains, as packages like Express for or utilities such as eliminated the need to reinvent common utilities, enabling focus on domain-specific logic and accelerating prototyping cycles from weeks to days in many cases. By promoting modular, single-responsibility packages, npm cultivated a culture of rapid contribution and refinement, where open-source maintainers iteratively improved libraries in response to needs, further compounding velocity. This , combined with semantic versioning support, minimized integration conflicts and facilitated scalable builds, underpinning the swift adoption of frameworks like and that rely on npm for core dependencies. In conjunction with , npm unified front-end and back-end workflows under , streamlining full-stack development and reducing context-switching overhead for teams, which contributed to faster deployment pipelines and broader innovation in web-scale applications. The resulting infrastructure has sustained JavaScript's preeminence, with npm remaining the for code distribution into 2025 despite emerging alternatives.

Dependency Bloat and Maintenance Burdens

Dependency bloat in npm ecosystems arises from the heavy reliance on modular packages, resulting in extensive transitive dependency trees that inflate project sizes far beyond direct imports. A 2023 Sonatype analysis found that typical JavaScript projects average 42 direct dependencies alongside 683 transitive ones, amplifying the total package count to often thousands per application. This proliferation contributes to node_modules directories routinely surpassing 100-700 MB even for modest projects, with installation processes extracting vast numbers of files—sometimes over 100,000—prolonging setup times and straining disk I/O, particularly in CI/CD pipelines or low-resource environments. Such bloat exacerbates maintenance burdens by necessitating constant oversight of indirect dependencies, many of which developers neither control nor fully utilize. Sonatype's report indicates teams must track an average of 1,500 dependency updates annually per application, diverting significant engineering effort toward auditing, testing, and resolving compatibility issues rather than core development. Surveys like the State of JavaScript (2021-2022) identify dependency management as the foremost pain point for developers, stemming from version conflicts, breaking changes, and the administrative load of tools like npm audit for vulnerability scanning. The security implications compound these challenges, as bloated trees expand the ; an empirical study of npm's dependency revealed that vulnerabilities in popular packages propagate to affect a of 30 downstream releases, underscoring the risks of unmaintained transitive code. Developers face ongoing burdens in patching these exposures, often requiring overrides or forks, which introduce further custom maintenance overhead and potential divergence from upstream fixes. While npm features like overrides and resolutions mitigate some issues, the systemic dependence on external maintainers—many packages authored by individuals with limited long-term commitment—perpetuates fragility, as evidenced by frequent and the need for community-driven revivals.

Economic and Productivity Trade-offs

The extensive npm registry, hosting over 2 million packages as of 2024, enables developers to rapidly incorporate specialized modules for tasks such as , HTTP routing, and utility functions, thereby reducing the time required to implement common functionalities from and allowing teams to prioritize application-specific logic. This reuse model fosters and specialization, contributing to faster prototyping and iteration cycles in projects, particularly in web and server-side development. However, this convenience introduces productivity costs through dependency bloat, where projects accumulate transitive and unused packages that inflate node_modules directories to hundreds of megabytes or more. Empirical analysis of 20,743 dependency commits across 1,487 npm-using projects found that 55.88% of build time tied to dependency updates stems from unused dependencies, prolonging install and test phases unnecessarily. Such overhead scales with project size, exacerbating delays in development workflows, especially in monorepos or pipelines where repeated resolutions of large dependency graphs consume developer and computational resources. Version conflicts and peer dependency mismatches further erode efficiency, as npm's resolution strategy—prioritizing nested duplicates over deduplication—often requires manual intervention or flags like --legacy-peer-deps, diverting hours from coding to configuration tweaks. Surveys of developers highlight persistent frustrations with these issues, including deprecations and , which correlate with reduced satisfaction in package handling despite overall growth. Maintenance burdens compound this, as teams must track technical lag—median outdated dependencies lasting 3.5 months—leading to compatibility breaks and refactoring efforts that offset initial gains. Economically, while npm accelerates market entry for startups by minimizing upfront coding costs, enterprises face elevated long-term expenses from bloated bundles increasing runtime memory usage and load times, potentially degrading and requiring compensatory scaling. Studies on server-side applications underscore how bloated CommonJS dependencies hinder performance optimization, with removal efforts yielding measurable reductions in bundle sizes and startup times, though at the expense of upfront auditing labor. In aggregate, these trade-offs reveal a causal tension: npm's low-barrier reuse amplifies short-term velocity but imposes systemic drags on and reliability, prompting shifts toward tools like pnpm for mitigation in resource-constrained environments.

Alternatives and Comparative Analysis

Deterministic Package Managers (, pnpm)

Yarn and pnpm address npm's historical challenges with non-deterministic dependency resolution by mandating lockfile-driven installs that yield identical node_modules structures from the same package.json and lockfile inputs, thereby enabling across environments and over time. This approach mitigates risks like silent version drifts or environment-specific variances that plagued early npm workflows. Yarn, released on October 11, 2016, by an open-source collaboration including Sebastian McKenzie of , pioneered widespread adoption of deterministic algorithms via its yarn.lock file, which captures exact dependency versions and checksums to prevent resolution inconsistencies. Key enhancements include parallel downloads for accelerated installs—often 2 to 5 times faster than equivalent npm operations—and built-in offline caching with integrity checks. Later versions, starting with Berry (2.0 in 2020), introduced Plug'n'Play mode to eliminate traditional node_modules folders in favor of zipped caches, further optimizing for speed and reduced disk overhead in monorepos via native workspace support. pnpm, achieving stable version 1.0 on June 28, 2017, diverges structurally by leveraging a centralized, content-addressable global store combined with hard links or symlinks in a non-flat node_modules , ensuring strict dependency scoping and avoiding the duplication inherent in 's or Yarn's flat layouts. The pnpm-lock.[yaml](/page/YAML) file enforces determinism while enabling up to 2x faster installs than through efficient reuse of shared packages across projects, yielding substantial disk savings—particularly in monorepos where space usage can drop by orders of magnitude compared to . This model also inherently blocks access to undeclared "phantom" dependencies, bolstering security and isolation beyond 's defaults. In benchmarks, pnpm often outperforms both and in cold-cache scenarios for large dependency graphs, with its symlink strategy providing finer-grained control and lower maintenance burdens in multi-package setups. While incorporated lockfiles (package-lock.json) in version 5 (June 2017) to achieve basic , and pnpm retain edges in raw performance, storage efficiency, and ergonomics, driving their preference in high-scale development despite 's dominance.

Enterprise and Monorepo Solutions

npm's workspaces feature, introduced in version 7 on October 27, 2020, enables monorepo management by defining multiple packages within a single repository via a workspaces array in the root package.json, allowing local inter-package linking and hoisting of shared dependencies to the root node_modules to minimize duplication and installation overhead. This setup supports atomic commits across projects, streamlined scripting via npm run commands that propagate to sub-packages, and efficient development workflows for teams handling interdependent modules, though it risks version conflicts in deeply nested dependency graphs without careful pinning. In enterprise contexts, where monorepos scale to hundreds of packages and enforce compliance, npm workspaces serve as a foundational layer but often require augmentation for , build optimization, and enforcement. Tools like facilitate , semantic versioning, and selective by executing npm scripts across packages, though its core functionality has shifted toward lighter integrations since deprecating heavier features in favor of native workspaces. For larger-scale enterprise needs, Nx extends npm workspaces with distributed task execution, computation via a local , and plugin-based , reducing build times in monorepos with thousands of files by up to 90% through incremental processing and analysis. Microsoft's Rush, designed for JavaScript monorepos in corporate environments, imposes rigorous policies on dependency resolution and phasing to prevent drift, integrates with PNPM for that cuts disk usage by avoiding redundant installs, and supports phased builds across teams, making it preferable for organizations prioritizing over flexibility. These solutions mitigate npm's native limitations in hoisting inconsistencies and lack of built-in caching, enabling reliable scaling while leveraging npm for core package operations.

Performance and Reliability Differences

Alternatives like and pnpm address npm's historical shortcomings in speed and disk efficiency through distinct architectural approaches. pnpm, for instance, employs a content-addressable store with hard links to a global package directory, enabling dependency sharing across projects and reducing redundant downloads, which results in up to 50-70% lower disk usage compared to npm's flat node_modules structure. Benchmarks demonstrate pnpm completing cold installs three times faster than npm in large projects, while leverages parallel downloads and caching to achieve speeds roughly twice that of npm in similar scenarios. Reliability differences stem primarily from dependency resolution strategies. npm's package-lock.json, introduced in version 5 (June 2017), enforces reproducible installs but can still permit non-deterministic outcomes if lockfiles are absent or registries vary, leading to potential version drift across environments. In contrast, Yarn's yarn.lock and pnpm's pnpm-lock. mandate strict, deterministic resolution by default, minimizing "works on my machine" discrepancies in team settings or pipelines; pnpm further enhances this by isolating dependencies via symlinks, preventing access to undeclared "phantom" packages that npm and Classic may inadvertently allow. For monorepos, Yarn's native workspaces (since version 1, 2017) and pnpm's scoped hoisting provide more reliable cross-package linking than npm's post-version 7 implementation, reducing symlink breakage risks during updates.
AspectnpmYarnpnpm
Install Speed (Cold Install, Large Project)Baseline~2x faster via caching~3x faster via hard links
Disk UsageHigh (duplicated packages)Moderate (shared cache optional)Low (50-70% savings)
DeterminismImproved with lockfile, but flexibleStrict with yarn.lockStrict, enforces isolation
Enterprise solutions such as Nx or Turborepo, when paired with or pnpm, amplify these advantages by enforcing consistent caching across distributed teams, though they introduce added complexity over npm's simplicity for small-scale use. Overall, while npm has optimized performance in versions 9+ (e.g., via better caching as of November 2022), alternatives prioritize and at the cost of occasional hurdles with npm-specific scripts.

References

  1. [1]
    About npm - npm Docs
    Oct 22, 2023 · npm is the world's largest software registry. Open source developers from every continent use npm to share and borrow packages.
  2. [2]
    npm | Home
    The free npm Registry has become the center of JavaScript code sharing, and with more than two million packages, the largest software registry in the world.Documentation · About · Sign In · Pricing
  3. [3]
    Mastering npm & npx in 2025: The Definitive Guide to Node.js
    May 1, 2025 · Npm, now at version 10.x, remains the default package manager bundled with Node and hosts over 2.5 million public packages, making it the ...
  4. [4]
    An introduction to the npm package manager - Node.js
    npm is the standard package manager for Node.js. In September 2022 over 2.1 million packages were reported being listed in the npm registry.
  5. [5]
    About npm
    npm is the package manager for Node.js. It was created in 2009 as an open source project to help JavaScript developers easily share packaged modules of code.
  6. [6]
    isaacs - GitHub
    I'm Isaac Z. Schlueter. I wrote npm and a pretty considerable portion of other node related JavaScript that you might use. I've been doing open source ...
  7. [7]
    NPM & left-pad: Have We Forgotten How To Program? - David Haney
    Mar 23, 2016 · A simple NPM package called left-pad that was a dependency of their code. left-pad, at the time of writing this, has 11 stars on GitHub.
  8. [8]
    kik, left-pad, and npm
    directly or indirectly — was unpublished by its author, as ...
  9. [9]
    npm-install - npm Docs
    This command installs a package and any packages that it depends on. If the package has a package-lock, or an npm shrinkwrap file, or a yarn lock file,Description · omit · strict-peer-deps · dry-run
  10. [10]
    Downloading and installing packages locally - npm Docs
    Oct 22, 2023 · You can install a package locally if you want to depend on the package from your own module, using something like Node.js require .
  11. [11]
    Downloading and installing packages globally - npm Docs
    Oct 22, 2023 · To download and install packages globally, on the command line, run the following command: npm install -g <package_name>
  12. [12]
    npm Best Practices - RisingStack Engineering
    Jul 4, 2024 · Learn the best practices of using npm: Installation, finding & investigating packages, saving or locking dependencies, securing projects and ...
  13. [13]
    Guide to managing npm packages in your package.json - Medium
    Oct 8, 2019 · Learning the npm commands of how to install or upgrade packages isn't hard. What I did find difficult for a long time were the best practices behind it.
  14. [14]
    Best Practices for Creating a Modern npm Package with Security in ...
    Feb 4, 2025 · In this tutorial, we're going to walk step by step through creating an npm package using modern best practices (as of 2025).
  15. [15]
    Understanding the npm dependency model - Alexis King
    Aug 24, 2016 · npm installs a tree of dependencies. That is, every package installed gets its own set of dependencies rather than forcing every package to share the same ...
  16. [16]
    Understanding npm dependency resolution | by Bhammarker Rahul
    Sep 24, 2017 · npm reads package.json file (which usually placed at the root directory) to install the dependencies and installed then under sub directory named “node_modules ...Dependency Resolution · Responses (6) · Ways Of Bootstrapping...Missing: process | Show results with:process
  17. [17]
    How npm3 Works | How npm Works
    npm3 resolves dependencies differently than npm2. While npm2 installs all dependencies in a nested way, npm3 tries to mitigate the deep trees and redundancy.Missing: hoisting | Show results with:hoisting
  18. [18]
    Understanding npm dependency resolution part 1 | by Rishav Thakur
    May 4, 2021 · So to sum it up what happens is that all your primary dependencies are stored in a flat way and to optimize and reduce the size of your ...
  19. [19]
    npm Blog Archive: v5.0.0
    May 25, 2017 · The npm blog has been discontinued. Updates from the npm team are now published on the GitHub Blog and the GitHub Changelog. v5.0.0. npm5.
  20. [20]
    package-lock.json | npm Docs
    ### Summary of package-lock.json
  21. [21]
    About semantic versioning - npm Docs
    Oct 22, 2023 · We recommend publishing a new version of the package with an updated version number in the package.json file that follows the semantic versioning spec.
  22. [22]
    Semantic Versioning 2.0.0 | Semantic Versioning
    We propose a simple set of rules and requirements that dictate how version numbers are assigned and incremented.2.0.0-rc.1 · 1.0.0-beta · 1.0.0 · Ar)
  23. [23]
    npm-version
    Run the preversion script. These scripts have access to the old version in package.json. A typical use would be running your full test suite before deploying.Synopsis · workspace · workspaces
  24. [24]
    Updating your published package version number - npm Docs
    Oct 22, 2023 · To change the version number in package.json, on the command line, in the package root directory, run the following command, replacing <update_type> with one ...Missing: rules | Show results with:rules
  25. [25]
    package.json - npm Docs
    Oct 4, 2025 · Description. This document is all you need to know about what's required in your package.json file. It must be actual JSON, ...
  26. [26]
    npm-publish | npm Docs
    Dec 11, 2023 · Description. Publishes a package to the registry so that it can be installed by name. By default npm will publish to the public registry.Description · Files included in package · workspace · workspaces
  27. [27]
    Creating and publishing scoped public packages - npm Docs
    To share your code publicly in a user or organization namespace, you can publish public user-scoped or organization-scoped packages to the npm registry.Creating a scoped public... · Reviewing package contents...
  28. [28]
    package-lock.json - npm Docs
    Sep 22, 2021 · package-lock.json is automatically generated for any operations where npm modifies either the node_modules tree, or package.json.Description · package-lock.json vs npm... · Hidden Lockfiles · Handling Old Lockfiles
  29. [29]
    About the public npm registry
    Sep 22, 2020 · The public npm registry is a database of JavaScript packages, each comprised of software and metadata. Open source developers and developers at companies use ...Missing: structure | Show results with:structure<|separator|>
  30. [30]
    NPM registry internals - Packagecloud Blog
    Jan 23, 2018 · An NPM registry is a collection of Node.js packages, metadata, and several API endpoints that are primarily accessed via the npm command line tool.
  31. [31]
    registry | npm Docs
    ### Summary of npm Registry Content
  32. [32]
    New npm Registry Architecture
    Feb 5, 2014 · This blog post describes some recent changes to the way that The npm Registry works, and can be relevant to you if you're replicating from the ...
  33. [33]
    About scopes | npm Docs
    Oct 22, 2023 · A scope allows you to create a package with the same name as a package created by another user or organization without conflict.
  34. [34]
    scope | npm Docs
    Sep 22, 2020 · Scoped packages can be published and installed as of npm@2 and are supported by the primary npm registry. Unscoped packages can depend on scoped ...Description · Installing scoped packages · Requiring scoped packages
  35. [35]
    npm Blog Archive: npm@2.0.0
    Sep 22, 2014 · npm@2.0.0 introduced passing arguments to scripts, a breaking change, and introduced scoped packages. It also changed semver to version 4.Missing: introduction date
  36. [36]
    An introduction to the npm package manager - Flavio Copes
    Jan 29, 2018 · npm is the standard package manager for Node.js. In January 2017 over 350000 packages were reported being listed in the npm registry.Introduction To Npm · How To Use Npm · Installing A Single Package
  37. [37]
    Organizations - npm Docs
    Oct 20, 2023 · Organizations allow teams of contributors to read and write public and private packages. Organizations are free when they publish public packages.Creating and managing... · Paying for your organization · Managing organization...
  38. [38]
    Creating an organization - npm Docs
    Any npm user can create an organization to manage contributor access to packages governed by the organization.
  39. [39]
    npm-cache
    npm stores cache data in an opaque directory within the configured cache, named _cacache. This directory is a cacache-based content-addressable cache.Synopsis · Description · Details · note about the cache's designMissing: mechanism | Show results with:mechanism
  40. [40]
    folders - npm Docs
    Cache files are stored in ~/.npm on Posix, or %LocalAppData%/npm-cache on Windows. This is controlled by the cache config param.prefix Configuration · Node Modules · Temp Files · Cycles, Conflicts, and Folder...
  41. [41]
    config - npm Docs
    Force offline mode: no network requests will be done during install. To allow the CLI to fill in missing cache data, see --prefer-offline . omit.
  42. [42]
    npm-ci
    Oct 4, 2022 · This command is similar to npm install, except it's meant to be used in automated environments such as test platforms, continuous integration, and deployment.
  43. [43]
    History of Node.js on a Timeline - RisingStack Engineering
    May 29, 2024 · Node.js was named in 2009, had early npm preview, and saw mainstream adoption in 2017, with 8.8 million online instances.
  44. [44]
    The secret history behind the success of npm and Node
    Jul 19, 2018 · So, for years as Node grew, npm became a way people published JavaScript to a shared repository, the npm registry, to build a program. It ...
  45. [45]
    NPM Version - GeeksforGeeks
    Jul 23, 2025 · Schlueter, NPM is written in JavaScript and was initially released on the 12th of January, 2010. As the default package manager, NPM is used to ...
  46. [46]
    Under-the-hood of NPM - Craig Taub
    May 30, 2021 · The initial release date for NPM was 12 January 2010 and since then has grown into the Worlds largest software registry.
  47. [47]
    npm 1.0: Released - Node.js
    May 1, 2011 · npm 1.0 has been released. Here are the highlights: The focus is on npm being a development tool, rather than an apt-wannabe.
  48. [48]
    An abbreviated history of JavaScript package managers
    Dec 28, 2019 · Npm, released on January 12, 2010, was the first package registry and package manager for node. On May 01, 2011, npm version 1 was released, ...
  49. [49]
    NPM registry in numbers - Futurice
    Sep 18, 2014 · Right on the front page of the npm registry there are some stats: Total Packages: 94 767; Most dependent upon 7071 underscore 6475 async 5604 ...Missing: historical 2011-2019
  50. [50]
    npm Blog Archive: npm weekly, #20: npm 3 is here(-ish)!
    Jun 25, 2015 · The eagerly anticipated npm 3 will have an official npm release today (or early tomorrow morning, depending on your time zone). A few things ...
  51. [51]
    npm Blog Archive: Announcing npm@6
    Apr 24, 2018 · We're excited to announce npm@6. This major update to npm includes powerful new security features for every developer who works with open source code.
  52. [52]
    npm passes the 1 millionth package milestone! What can we learn?
    Jun 4, 2019 · January 2010: npm was created by Isaac Z. Schlueter, written in JavaScript. March 2016: popular JavaScript package, left-pad, was unpublished ...
  53. [53]
    npm is joining GitHub - The GitHub Blog
    Mar 16, 2020 · I'm excited to announce that GitHub has signed an agreement to acquire npm. npm is a critical part of the JavaScript world.
  54. [54]
    GitHub - Wikipedia
    In March 2020, GitHub announced that it was acquiring npm, a JavaScript packaging vendor, for an undisclosed sum of money. The deal was closed on April 15, ...Timeline of GitHub · GitHub Copilot · Censorship of GitHub · Git
  55. [55]
    What's New in npm? by Darcy Clarke - GitNation
    NPM CLI version 7 introduced several new features such as automatic installation of peer dependencies, enhanced performance for installation commands, workspace ...Missing: modern | Show results with:modern
  56. [56]
    Is npm Enough? Why Startups are Coming after this JavaScript ...
    Jan 30, 2025 · The technical side is data storage, which is not inconsequential considering the registry's scale and the number of downloads it has to support.
  57. [57]
    npm-audit
    The audit command submits a description of the dependencies configured in your project to your default registry and asks for a report of known vulnerabilities.Missing: tools | Show results with:tools
  58. [58]
    Auditing package dependencies for security vulnerabilities - npm Docs
    Oct 23, 2023 · A security audit is an assessment of package dependencies for security vulnerabilities. Security audits help you protect your package's users.Missing: built- | Show results with:built-
  59. [59]
    `npm audit`: identify and fix insecure dependencies
    May 8, 2018 · npm audit is a new command that performs a moment-in-time security review of your project's dependency tree.
  60. [60]
    npm Chalk and Debug Packages Hit in Software Supply Chain Attack
    Sep 9, 2025 · The attack began when a threat actor successfully gained control of a developer's npm account, enabling them to publish malicious versions of ...Missing: common | Show results with:common<|separator|>
  61. [61]
    lessons from the largest npm supply chain compromise | CyberScoop
    Sep 15, 2025 · Attackers successfully injected malicious code into 18 popular npm packages, collectively accounting for more than 2.6 billion weekly downloads.
  62. [62]
    npm: Threats and Mitigations
    Jul 8, 2024 · By "typosquatting" / dependency confusion​​ npm is able to detect typosquat attacks and block the publishing of these packages. A variant of this ...By compromising passwords · By registering an expired... · By "typosquatting...
  63. [63]
    Thousands Download Malicious npm Libraries Impersonating ...
    Dec 19, 2024 · Threat actors have been observed uploading malicious typosquats of legitimate npm packages such as typescript-eslint and @types/node that have racked up ...
  64. [64]
    A new, stealthier type of Typosquatting attack spotted targeting NPM?
    May 9, 2023 · Attackers have been using lowercase letters in package names on the Node Package Manager (NPM) registry for potential malicious package impersonation.Brief History of Package... · The Impersonation Threat · stealthier approach to...
  65. [65]
    Malicious Packages in npm Targeting Azure Developers - JFrog
    Mar 23, 2022 · The attack method is typosquatting – the attacker simply creates a new (malicious) package with the same name as an existing @azure scope ...
  66. [66]
    Nearly 18,000 New Malicious Packages Discovered in Q1 - Sonatype
    Apr 2, 2025 · Sonatype's Q1 2025 report reveals 17954 new open source malware packages, highlighting the need for robust software supply chain security.Missing: statistics | Show results with:statistics
  67. [67]
    Shai-Hulud npm Supply Chain Attack | Wiz Blog
    Sep 16, 2025 · Learn how the Shai-Hulud npm worm compromised 100+ packages with data-stealing malware. See how it spreads, the risks, and steps to detect ...
  68. [68]
    Over 70 Malicious npm and VS Code Packages Found Stealing ...
    May 26, 2025 · 60 npm packages and VS Code extensions deployed sandbox-evasive malware to steal system data, developer credentials, and crypto wallets.Missing: statistics | Show results with:statistics
  69. [69]
    NPM Security best practices - OWASP Cheat Sheet Series
    NPM Security best practices¶ · 1) Avoid publishing secrets to the npm registry¶ · 2) Enforce the lockfile¶ · 3) Minimize attack surfaces by ignoring run-scripts¶.1) Avoid publishing secrets to... · 6) Artifact governance and... · 8) Enable 2FA
  70. [70]
    How one programmer broke the internet by deleting a tiny piece of ...
    It meant that the code they were trying to run required a package called left-pad , but the npm registry didn't have it. Most programmers had never heard of ...
  71. [71]
    How one developer just broke Node, Babel and thousands of ...
    Mar 23, 2016 · To fix the internet, Laurie Voss, CTO and cofounder of NPM, took the "unprecedented" step of restoring the unpublished left-pad 0.0.3 that apps ...
  72. [72]
    After npm JavaScript Package Fiasco, Firm Changes Policy, Says ...
    Mar 30, 2016 · npm Inc. has changed its policy regarding the removal of packages after a module naming squabble broke thousands of JavaScript builds last ...
  73. [73]
    Details about the event-stream incident - The npm Blog
    Nov 27, 2018 · On the morning of November 26th, npm's security team was notified of a malicious package that had made its way into event-stream, a popular npm package.
  74. [74]
    Malicious code found in npm package event-stream downloaded 8 ...
    Nov 27, 2018 · An overview of how the malicious flatmap-stream npm package operates, and remediation steps to follow if you've been affected.
  75. [75]
    Supply Chain Compromises Through Node.js Packages | Mandiant
    Dec 15, 2021 · The latter is a technique known as typosquatting. NPM modules are a valuable target for threat actors due to their popularity amongst ...
  76. [76]
    Malware Discovered in Popular NPM Package, ua-parser-js - CISA
    Oct 22, 2021 · Versions of a popular NPM package named ua-parser-js was found to contain malicious code. ua-parser-js is used in apps and websites to discover the type of ...
  77. [77]
    NPM Library (ua-parser-js) Hijacked | Rapid7 Blog
    Oct 25, 2021 · A widely utilized NPM package, ua-parser-js, was embedded with a malicious script intended to install a coinminer and harvest user/credential information.
  78. [78]
    S1ngularity - What Happened, How We Responded, What ... - NX Dev
    Sep 5, 2025 · Malicious Nx packages were published to npm via GitHub Actions exploit. Learn what happened and how we enhanced security measures.
  79. [79]
    s1ngularity: supply chain attack leaks secrets on GitHub - Wiz
    Aug 28, 2025 · Detect and mitigate a critical supply chain compromise affecting the Nx NPM Package. Organizations should act urgently.
  80. [80]
    The s1ngularity attack: When attackers prompt your AI agents to do ...
    Oct 7, 2025 · Okta details how weaponized AI agents use malicious prompts on local LLMs (like Gemini and Claude) to steal developer credentials and bypass ...
  81. [81]
    Breakdown: Widespread npm Supply Chain Attack Puts Billions of ...
    Sep 10, 2025 · On September 8, 2025, the JavaScript ecosystem faced a major supply chain attack targeting 18 widely used npm packages. These packages alone ...
  82. [82]
    Widespread npm Supply Chain Attack: Breaking Down Impact ... - Wiz
    Sep 8, 2025 · What happened? On September 8th, 2025, at around 9AM EST, a threat actor had managed to gain control of the npm account of well-known developer ...Missing: 2019-2022 | Show results with:2019-2022
  83. [83]
    "Shai-Hulud" Worm Compromises npm Ecosystem in Supply Chain ...
    Sep 23, 2025 · Self-replicating worm “Shai-Hulud” has compromised hundreds of software packages in a supply chain attack targeting the npm ecosystem.Missing: 2023 | Show results with:2023
  84. [84]
    Our plan for a more secure npm supply chain - The GitHub Blog
    Sep 22, 2025 · GitHub is strengthening npm's security with stricter authentication, granular tokens, and enhanced trusted publishing.Missing: strategies | Show results with:strategies
  85. [85]
    Widespread Supply Chain Compromise Impacting npm Ecosystem
    Sep 23, 2025 · CISA is releasing this Alert to provide guidance in response to a widespread software supply chain compromise involving the world's largest ...Missing: statistics 2023-2025<|control11|><|separator|>
  86. [86]
    The "Shai-Hulud" npm Supply Chain Attack: What We Know - Reflectiz
    Sep 21, 2025 · Supply chain attacks increased 742% between 2019-2023 and continue doubling since April 2025; npm hosts 3.5 million packages – making it a ...
  87. [87]
    Ongoing npm Software Supply Chain Attack Exposes New Risks
    Sep 17, 2025 · Unlike one-off malicious packages that need to be manually introduced, self-replicating malware accelerates the spread, making it far more ...The Timeline So Far · What Wormable Malware Does · How Sonatype Helps You Stay...Missing: 2018-2022 | Show results with:2018-2022
  88. [88]
    npm in Review: A 2023 Retrospective on Growth, Security, and...
    Jan 10, 2024 · The official npm statistics showed more than 2.5 million live packages by the end of 2023, with download counts exceeding a staggering 184 billion package ...Missing: 2011-2019 | Show results with:2011-2019<|control11|><|separator|>
  89. [89]
    Javascript And Node.js: How Open Source Fuelled The Web's ...
    Jul 17, 2025 · Node.js, by enabling JavaScript on the server, has empowered full-stack development, accelerated project delivery, and supported high- ...
  90. [90]
    Why That 'Simple' npm Package Is a Ticking Time Bomb in Your ...
    Apr 8, 2025 · npm packages aren't inherently bad. The ecosystem has enabled unprecedented productivity and innovation in JavaScript development. But ...
  91. [91]
    Web Dev Origins: The History of npm
    npm v6: Security Comes First. Problem: Security vulnerabilities in packages were going undetected.
  92. [92]
    npm in 2025: Still the Beating Heart of JavaScript Development
    npm in 2025 remains the backbone of JavaScript development, powering React, Vue, and countless apps. Explore why npm matters, the challenges developers face ...
  93. [93]
    When to Use Node.js and Get the Most from It? - Uptech
    Aug 11, 2025 · Thanks to the Node.js default package manager (npm), the framework provides a broad platform for JavaScript tools. What makes the Node.js ...
  94. [94]
    The Real Story of npm: How It Changed JavaScript Development ...
    Aug 29, 2025 · You use npm daily but probably don't know why it exists or how it actually works. ♂️ Most developers just run commands without understanding ...
  95. [95]
    Is it normal to have a 100K files/780 MB in the node_modules ...
    Aug 23, 2016 · The node_modules folder is a 100k files/780 MB, and it flabbergasts me that this much is needed. (Numbers are on a dev environment, but compilation is done ...Do you actually care about the size of node_modules? - RedditHow much space does Node.js take? - RedditMore results from www.reddit.com
  96. [96]
    Node module size: See how I reduced it by 90% | TSH.io
    Jul 5, 2023 · Most of our projects have seen +-33% reduction of node_modules size after we've used it (176MB). The -watch flag is one of the new experimental ...
  97. [97]
    [PDF] Sonatype - 9th Annual State of the Software Supply Chain
    dependencies but are also tasked with track- ing an average of 1,500 dependency changes per year per application, possessing security and legal expertise to ...
  98. [98]
    State of JS 2021/2022: What Did We Learn? | Bits and Pieces
    Feb 22, 2022 · The question here was: Which aspect of JavaScript do you struggle with the most? The biggest pain point for developers is managing dependencies.
  99. [99]
    On the impact of security vulnerabilities in the npm package ...
    This paper presents an empirical study of nearly 400 security reports over a 6-year period in the npm dependency network containing over 610k JavaScript ...
  100. [100]
    On the Impact of Security Vulnerabilities in the npm and RubyGems ...
    Jun 12, 2021 · Vulnerabilities in npm packages affect a median of 30 package releases, while this is 59 releases in RubyGems packages. A large proportion of ...
  101. [101]
    Initial Analysis of NPM packages at the End of the Chain - arXiv
    Oct 6, 2025 · The Node Package Manager (NPM), one of the largest ecosystems of ... productivity benefits of code reuse. We present a series of open ...
  102. [102]
    An Empirical Study of Unused Dependencies in the npm Ecosystem
    Jul 12, 2024 · Our findings illustrate that 55.88% of the CI build time that is associated with dependency updates is only triggered by unused dependencies.
  103. [103]
    What's new in the 2025 State of JavaScript survey - DEV Community
    Oct 1, 2025 · Meanwhile, we still struggle with npm peer dependencies, deprecations and vulnerabilities, package manager syntax and obscure configuration ...Missing: issues | Show results with:issues
  104. [104]
  105. [105]
    An empirical study of bloated dependencies in CommonJS packages
    May 28, 2024 · In this paper, we conduct an empirical study to investigate the bloated dependencies that are entirely unused within server-side applications.Missing: productivity | Show results with:productivity
  106. [106]
    The Hidden Cost of NPM Dependencies — How We Cut Bundle ...
    Apr 6, 2025 · According to Sonatype's 2023 research, the average JavaScript project contains 42 direct dependencies and 683 transitive dependencies, with 65% ...
  107. [107]
    Yarn: A new package manager for JavaScript - Engineering at Meta
    Oct 11, 2016 · Yarn resolves these issues around versioning and non-determinism by using lockfiles and an install algorithm that is deterministic and reliable.Missing: history | Show results with:history
  108. [108]
    yarnpkg/yarn: The 1.x line is frozen - features and bugfixes ... - GitHub
    Reliable: Using a detailed but concise lockfile format and a deterministic algorithm for install operations, Yarn is able to guarantee that any installation ...
  109. [109]
    Yarn determinism | Yarn Blog - Yarn Classic
    May 31, 2017 · This blog post highlights how both Yarn and npm 5 are deterministic, but differ in the exact guarantees they provide and the tradeoffs they have chosen.Missing: history | Show results with:history
  110. [110]
  111. [111]
    Home page | Yarn
    ### Summary of Yarn Package Manager
  112. [112]
    pnpm version 1 is out! - Medium
    Jun 28, 2017 · Today we're excited to announce the release of pnpm 1! on Jan 27, 2016. It was based on the ideas of ied by Alexander Gugel with initial commit ...
  113. [113]
    Fast, disk space efficient package manager | pnpm
    ### Summary of pnpm from https://pnpm.io/
  114. [114]
    Why you should prefer using pnpm over npm and yarn? - Refine.dev
    Jul 2, 2024 · pnpm is faster, more disk efficient, and has improved speed, security, and dependency isolation compared to npm and yarn.
  115. [115]
  116. [116]
    npm Blog Archive: Monorepos and npm
    Jul 23, 2019 · Monorepos are a popular solution to this problem. Instead of one code repository per module, you put all modules in the same code repository.
  117. [117]
    Using `npm` Workspaces for Monorepo Management - Earthly Blog
    Oct 6, 2023 · This tutorial explores the use of `npm` workspaces for managing monorepos in software development. It covers the benefits and limitations of ...Missing: enterprise | Show results with:enterprise
  118. [118]
    Node.js and npm: 9 Enterprise Tips That Actually Work
    Aug 24, 2025 · Standardize Dependency Management with npm Workspaces ... A monorepo consolidates all those services, plus their shared libraries, under one roof.
  119. [119]
    Setting up Monorepo With Npm Workspaces and Lerna - Hackernoon
    May 10, 2023 · In this article, we have seen how we can set up and manage a monorepo with Lerna and Npm workspaces. Though Lerna is a great tool, you don't ...Why Use Lerna? · Project Setup · Getting Started<|control11|><|separator|>
  120. [120]
    Top 5 Monorepo Tools for 2025 | Best Dev Workflow Tools - Aviator
    Jun 23, 2025 · Monorepo tools like Bazel, Nx, Pants, and Turborepo help teams manage large codebases by offering incremental builds, caching, and dependency ...
  121. [121]
    NX vs Lerna vs Rush, can anyone comment on their experience ...
    Nov 30, 2021 · Rush is very well suited for large scale monorepos and for large companies that need full control over everything that is happening. The problem ...Lerna vs Turborepo vs Rush: The best monorepo tool : r/javascriptTools for monorepo management - packages linking, versioning ...More results from www.reddit.com
  122. [122]
    Rush vs Nx: A Comparison of TypeScript Monorepo Management ...
    Nov 11, 2020 · Rush and Nx: differences in their goals, capabilities, their approach to structuring projects, and the overall developer experience.
  123. [123]
    pnpm vs npm
    This lets you get the benefits of far less disk space usage, while also keeping your node_modules clean.
  124. [124]
    pnpm vs npm – Which one should I use in real-world projects and ...
    Disk space: 50-70% savings through hard-linking, still significant vs npm v9+ · Speed: Faster installs, especially in CI/CD · Strict dependencies: Prevents ...
  125. [125]
    NPM vs Yarn vs PNPM: Why so many? - DEV Community
    May 29, 2025 · In 2025, PNPM is the best all-around choice for most developers. It's fast, efficient, and increasingly well-supported across the ecosystem.
  126. [126]
    Understanding Package Managers: pnpm vs npm vs yarn
    Aug 8, 2024 · Additionally, Yarn offers better offline support, more predictable and deterministic installs, and improved security by verifying the integrity ...
  127. [127]
    Choosing the Right JavaScript Package Manager in 2025: npm vs ...
    Apr 18, 2025 · ✓ Pros: · Faster than npm, especially with caching. · Deterministic installs via yarn.lock. · Built-in support for monorepos (workspaces). · Yarn 2+ ...
  128. [128]