pnpm not found

Hi! I'm having trouble building my app, and haven't had success with any of the suggestions with other "pnpm not found" searches. My railway.json:
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"nixpacksPlan": {
"providers": ["python"],
"phases": {
"setup": {
"nixPkgs": ["..."]
}
}
},
"buildCommand": "pnpm i --frozen-lockfile --force && pnpm -F frontend build"
},
"deploy": {
"startCommand": "python manage.py migrate && python manage.py collectstatic --no-input && gunicorn faves_project.wsgi",
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"nixpacksPlan": {
"providers": ["python"],
"phases": {
"setup": {
"nixPkgs": ["..."]
}
}
},
"buildCommand": "pnpm i --frozen-lockfile --force && pnpm -F frontend build"
},
"deploy": {
"startCommand": "python manage.py migrate && python manage.py collectstatic --no-input && gunicorn faves_project.wsgi",
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}
The build error I'm seeing:
#12 [stage-0 8/10] RUN pnpm i --frozen-lockfile --force && pnpm -F frontend build
#12 0.295 /bin/bash: line 1: pnpm: command not found
#12 ERROR: process "/bin/bash -ol pipefail -c pnpm i --frozen-lockfile --force && pnpm -F frontend build" did not complete successfully: exit code: 127
-----
> [stage-0 8/10] RUN pnpm i --frozen-lockfile --force && pnpm -F frontend build:
0.295 /bin/bash: line 1: pnpm: command not found
-----
Dockerfile:24
-------------------
22 | # build phase
23 | COPY . /app/.
24 | >>> RUN pnpm i --frozen-lockfile --force && pnpm -F frontend build
25 |
26 |
-------------------
ERROR: failed to solve: process "/bin/bash -ol pipefail -c pnpm i --frozen-lockfile --force && pnpm -F frontend build" did not compl
#12 [stage-0 8/10] RUN pnpm i --frozen-lockfile --force && pnpm -F frontend build
#12 0.295 /bin/bash: line 1: pnpm: command not found
#12 ERROR: process "/bin/bash -ol pipefail -c pnpm i --frozen-lockfile --force && pnpm -F frontend build" did not complete successfully: exit code: 127
-----
> [stage-0 8/10] RUN pnpm i --frozen-lockfile --force && pnpm -F frontend build:
0.295 /bin/bash: line 1: pnpm: command not found
-----
Dockerfile:24
-------------------
22 | # build phase
23 | COPY . /app/.
24 | >>> RUN pnpm i --frozen-lockfile --force && pnpm -F frontend build
25 |
26 |
-------------------
ERROR: failed to solve: process "/bin/bash -ol pipefail -c pnpm i --frozen-lockfile --force && pnpm -F frontend build" did not compl
I have a pnpm-lock.yaml in my root directory. My project id: 90e8bbd5-6381-4906-9853-3d5ea1445654
Solution:
try extending your nixPkgs array with nodePackages.pnpm
Jump to solution
14 Replies
Percy
Percy10mo ago
Project ID: 90e8bbd5-6381-4906-9853-3d5ea1445654
Solution
Brody
Brody10mo ago
try extending your nixPkgs array with nodePackages.pnpm
holy shnikes
holy shnikes10mo ago
Hm, not sure what you mean
Brody
Brody10mo ago
take a look at your own railway.json again please do you see your nixPkgs array?
holy shnikes
holy shnikes10mo ago
yes
Brody
Brody10mo ago
append nodePackages.pnpm to that array
holy shnikes
holy shnikes10mo ago
Just "nixPkgs": ["...", nodePackages.pnpm]?
Brody
Brody10mo ago
well it's a string so it needs to be quoted
holy shnikes
holy shnikes10mo ago
Yep, okay, that's why I was asking specifically what you meant by extend
Brody
Brody10mo ago
vscode can validate the railway.json for you it can't tell you if it will do what you intend, but it will tell you if it's valid
holy shnikes
holy shnikes10mo ago
I was editing directly on a test branch in the github ui anyway, thanks
Brody
Brody10mo ago
ah lol interesting did it work?
holy shnikes
holy shnikes10mo ago
yep!
Brody
Brody10mo ago
awesome!