npm by default during deployments. However, if you prefer to use an alternative JavaScript package manager like Yarn, Bun, or PNPM, you can do so by customizing your build commands.
For Laravel and Symfony applications, Laravel Cloud doesn’t install these tools for you, but you can install them in your build commands. JavaScript applications, such as Next.js, Nuxt, and TanStack Start, can run on the Bun runtime directly. Laravel Cloud detects it automatically when your repository contains a bun.lock, bun.lockb, or bunfig.toml file. See Runtimes for details.
If you plan to use a different JavaScript package manager via the examples below, be sure to remove or comment out the default
npm commands in your build commands before adding the custom commands.Example: Using Bun
If you would like to use Bun instead of npm, you can override the default build command in your site’s settings with the following:Example: Using Yarn
To use Yarn instead of npm:Example: Using PNPM
To use PNPM instead of npm:Approving PNPM build scripts
PNPM blockspostinstall and other build scripts for dependencies it doesn’t recognize, so packages with native binaries (for example, esbuild or sharp) may silently fail to build. Watch for an “Ignored build scripts” warning in your build log.
Since Laravel Cloud’s build step is non-interactive, approve these scripts locally first, then commit the resulting configuration so the approval is already in place when Cloud builds your application:
allowBuilds map to pnpm-workspace.yaml. On PNPM 9 and 10, it writes an onlyBuiltDependencies array to the pnpm key in package.json instead. Either file should be committed to your repository.
A
.npmrc with auto-install-peers or node-linker=hoisted does not approve build scripts and won’t fix this; use pnpm approve-builds instead.
