Skip to docs content

node_modules layout

scpm defaults to an isolated symlink layout like pnpm's node-linker=isolated. The difference is directory ownership: scpm writes .scpm/, not .pnpm/.

project/
  node_modules/
    react -> .scpm/react@18.2.0/node_modules/react
    .scpm/
      react@18.2.0/
        node_modules/
          react/
          loose-envify -> ../../loose-envify@1.4.0/node_modules/loose-envify

Why isolated

Only declared direct dependencies appear at the project top level. Transitive dependencies are linked next to the packages that declared them, so phantom dependencies fail instead of being accidentally available.

Hoisted mode

scpm install --node-linker=hoisted

Hoisted mode writes a flatter npm-style tree for tools that assume most packages are visible at the top level.

Global store

Package files are stored by content hash under:

$XDG_DATA_HOME/scpm/store/v1/

This defaults to ~/.local/share/scpm/store/v1/ when $XDG_DATA_HOME is unset. Run scpm store path to see the resolved location.

scpm imports files from that store into the virtual store with reflinks, hardlinks, or copies depending on filesystem support and package-import-method.

Global virtual store

The global virtual store reuses materialized package directories across projects. It is on by default outside CI and off under CI.

Coexistence with pnpm

scpm does not reuse node_modules/.pnpm/ or ~/.pnpm-store/. If a pnpm-built tree already exists, scpm installs alongside it in node_modules/.scpm/.