Failing to build using pnpm ("No package.json found in /app")
Anonymous
FREEOP

10 months ago

Hello, whenever I try deploying my project using PNPM as my package manager I keep encountering errors.

I get the following logs:

 Corepack is about to download https://registry.npmjs.org/pnpm/-/pnpm-10.13.1.tgz
 ERR_PNPM_NO_PKG_MANIFEST  No package.json found in /app

ERROR: failed to build: failed to solve: process "sh -c pnpm install" did not complete successfully: exit code: 1

However, I have a package.json file, and I have it properly configured (I believe).

I was getting a different error when using Nixpacks, but when I switched to Railpack I get this one instead.

$10 Bounty

8 Replies

Anonymous
FREEOP

10 months ago

edffc748-0642-4620-b4ca-3df2650a0972


Anonymous
FREEOP

10 months ago


smolpaw
HOBBY

10 months ago

What was the error with Nixpacks ?

Also have you set or changed the Root directory for your service ?

Attachments


Anonymous
FREEOP

10 months ago

Nixpacks said

ERROR  packages field missing or empty
For help, run: pnpm help install

ERROR: failed to build: failed to solve: process "/bin/bash -ol pipefail -c pnpm i --frozen-lockfile" did not complete successfully: exit code: 1

Anonymous
FREEOP

10 months ago

And I haven't changed the root directory


smolpaw
HOBBY

10 months ago

The nixpacks has the same exact error you are facing with railpack. Both of them are unable to find your package.json file and pnpm-lock.yaml file

Have a look at your repo is the package.json file in /<some_dir>/package.json ?

In that case you do need to change the Root directory on railway to be /<some_dir>


Anonymous
FREEOP

10 months ago

They are in the root directory of the repo, and I haven't changed the root directory on railway


smolpaw
HOBBY

10 months ago

Would it be possible to add me to your repo so i can have a look and fix whatever the issue is ?

I could dm you privately.


Welcome!

Sign in to your Railway account to join the conversation.

Loading...