Documentation navigation
Anybuild documentation

Node.js

Package-manager detection, framework-aware commands, and dependency optimization.

Detection

The Node provider recognizes Node start/install commands, package.json, application framework dependencies, runtime server dependencies, and common JavaScript server entry files. Static-capable projects are evaluated by the higher-priority node-static provider first.

Supported frameworks

The Node.js provider recognizes the following application frameworks. Frameworks that produce static output are selected by the Node Static provider when the project is configured for a static build.

FrameworkConfig valuePrimary detection
Next.jsnextnext
Astroastroastro
Hydrogenhydrogen@shopify/hydrogen or @shopify/remix-oxygen
React Routerreact-router@react-router/dev, @react-router/node, or @react-router/serve
Remixremix@remix-run development or runtime packages
SvelteKitsveltekit@sveltejs/kit
SolidStartsolidstart@solidjs/start or solid-start
TanStack Starttanstack-start@tanstack/react-start or @tanstack/solid-start
NestJSnestjs@nestjs core or platform packages
XMCPxmcpxmcp
Mastramastramastra or @mastra/core

Set ANYBUILD_NODE_FRAMEWORK to the config value when automatic detection is not sufficient.

Package manager

Anybuild reads the packageManager field first, then workspace and lockfile evidence for npm, pnpm, Yarn, or Bun. It stages lockfiles before installing so dependency work can be cached independently from source changes.

Build and start commands

Build scripts and known framework commands determine the build step. Start inference considers package.json scripts, its main field, and common files such as server.js, app.js, index.js, src/server.js, and src/index.js.

Framework and server are detected independently. For example, a project can use TanStack Start as its framework and Nitro as its server, or NestJS with Express.

Common configuration

VariablePurposeExample value
ANYBUILD_NODE_VERSIONNode.js package version; current default is 24.24
ANYBUILD_NODE_PACKAGE_MANAGERForce npm, pnpm, yarn, or bun.pnpm
ANYBUILD_NODE_FRAMEWORKForce the detected application framework.next
ANYBUILD_NODE_SERVERForce the Node.js runtime server or adapter.node
ANYBUILD_NODE_BUILD_COMMANDOverride the detected build command.npm run build
ANYBUILD_EDGEJS_ENABLEUse EdgeJS for compatible deployments.true
ANYBUILD_EDGEJS_PRECOMPILEPrecompile JavaScript modules for EdgeJS.true
ANYBUILD_OPTIMIZE_NODE_DEPENDENCIESEnable dependency tracing for supported framework outputs.true
ANYBUILD_NODE_REMOVE_NATIVE_BINARIESRemove executable native binaries from Edge-targeted dependencies.false