npm: not found
salvationarinze
HOBBYOP

15 days ago

I have a deployment activate and make a little code change and on pushing, I'm getting this now. It's s laravel app but somehow RailPack seems not to detected the package.json in other to set up node

↳ Detected Php

Packages

──────────

php │ 8.4.18 │ railpack default (8.4)

sh: 1: npm: not found

Build Failed: build daemon returned an error < failed to solve: process "sh -c npm run build:ssr" did not complete successfully: exit code: 127 >

$10 Bounty

2 Replies

angeldanielmartinez424-glitch
FREETop 10% Contributor

15 days ago

El error ocurre porque Railway solo detecta PHP. Como el package.json no está en la raíz del proyecto, Nixpacks no activa el entorno Node, por eso npm no existe. La solución es mover package.json a la raíz del proyecto para que Railway detecte y configure automáticamente Node junto con PHP.


darseen
HOBBYTop 5% Contributor

15 days ago

package.json should be in the root directory in order for Railpack to install node.js. Check the docs here.


Loading...