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.
| Framework | Config value | Primary detection |
|---|---|---|
| Next.js | next | next |
| Astro | astro | astro |
| Hydrogen | hydrogen | @shopify/hydrogen or @shopify/remix-oxygen |
| React Router | react-router | @react-router/dev, @react-router/node, or @react-router/serve |
| Remix | remix | @remix-run development or runtime packages |
| SvelteKit | sveltekit | @sveltejs/kit |
| SolidStart | solidstart | @solidjs/start or solid-start |
| TanStack Start | tanstack-start | @tanstack/react-start or @tanstack/solid-start |
| NestJS | nestjs | @nestjs core or platform packages |
| XMCP | xmcp | xmcp |
| Mastra | mastra | mastra 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
| Variable | Purpose | Example value |
|---|---|---|
ANYBUILD_NODE_VERSION | Node.js package version; current default is 24. | 24 |
ANYBUILD_NODE_PACKAGE_MANAGER | Force npm, pnpm, yarn, or bun. | pnpm |
ANYBUILD_NODE_FRAMEWORK | Force the detected application framework. | next |
ANYBUILD_NODE_SERVER | Force the Node.js runtime server or adapter. | node |
ANYBUILD_NODE_BUILD_COMMAND | Override the detected build command. | npm run build |
ANYBUILD_EDGEJS_ENABLE | Use EdgeJS for compatible deployments. | true |
ANYBUILD_EDGEJS_PRECOMPILE | Precompile JavaScript modules for EdgeJS. | true |
ANYBUILD_OPTIMIZE_NODE_DEPENDENCIES | Enable dependency tracing for supported framework outputs. | true |
ANYBUILD_NODE_REMOVE_NATIVE_BINARIES | Remove executable native binaries from Edge-targeted dependencies. | false |