Question

How to setup DO app platform with pnpm monorepo

I setup digital ocean app platform. Ran static site building with pnpm monorepo.

At first run all went great, but at second, when digital ocean took node_modules from cache I received error of empty node_modules folder. I tried install dependencies from building script as it’s describe in article, but this isn’t help. Is it any I can do to fix this currently?

https://docs.digitalocean.com/products/app-platform/reference/buildpacks/nodejs/#pnpm

pnpm 9.0.6 installed
[INFO] No file to start server
[INFO] either use 'docker run' to start container or add index.js or server.js
Project contains pnpm-lock.yaml, using pnpm
Reusing cached node_modules from pnpm-lock.yaml
Running custom build command: pnpm run setup && cd apps/private && pnpm run build

> app_name@1.0.0 setup /workspace
> pnpm install --production=false

Scope: all 6 workspace projects
? The modules directories will be removed and reinstalled from scratch. Proceed? (Y/n) ‣ true
> private@0.0.0 build /workspace/apps/private
> tsc && vite build

sh: 1: tsc: not found
ELIFECYCLE  Command failed.
WARN   Local package.json exists, but node_modules missing, did you mean to install?
building: exit status 1
ERROR: failed to build: exit status 1

Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

I’m having a similar issue, and it’s not a monorepo:

[2024-05-15 02:56:15] ╭──────────── app build ───────────╼
[2024-05-15 02:56:15] │ ---> Node.js Buildpack
[2024-05-15 02:56:15] │ ---> Installing toolbox
[2024-05-15 02:56:15] │ ---> - jq
[2024-05-15 02:56:15] │ ---> - yj
[2024-05-15 02:56:16] │ ---> Getting Node version
[2024-05-15 02:56:16] │ ---> Resolving Node version
[2024-05-15 02:56:16] │ ---> Downloading and extracting Node v18.18.2
[2024-05-15 02:56:17] │ ---> Parsing package.json
[2024-05-15 02:56:17] │ ---> No file to start server
[2024-05-15 02:56:17] │ ---> either use 'docker run' to start container or add index.js or server.js
[2024-05-15 02:56:17] │ Project contains pnpm-lock.yaml, using pnpm
[2024-05-15 02:56:17] │ Installing node_modules using pnpm (from pnpm-lock.yaml)
[2024-05-15 02:56:17] │ unable to invoke layer creator
[2024-05-15 02:56:17] │ installing node_modules: exec: "pnpm": executable file not found in $PATH
[2024-05-15 02:56:17] │ ERROR: failed to build: exit status 1
[2024-05-15 02:56:18] │ 
[2024-05-15 02:56:18] │ 
[2024-05-15 02:56:18] │ For documentation on the buildpacks used to build your app, please see:
[2024-05-15 02:56:18] │ 
[2024-05-15 02:56:18] │    Node.js  v0.4.0  https://do.co/apps-buildpack-node
[2024-05-15 02:56:18] │ 
[2024-05-15 02:56:18] │  ✘ build failed
Bobby Iliev
Site Moderator
Site Moderator badge
May 8, 2024

Hi there,

Quick update here in case that anyone comes across this in the future.

DigitalOcean have updated the NodeJS buildpack for App Platform.

The buildpack now supports the PNPM package manager. For more information and configuration options, see the buildpack’s documentation page.

Hope that this helps!

Best,

Bobby

We are also experiencing issues deploying our pnpm monorepo. For us, pnpm doesn’t seem to be installed before the node_modules are attempted to be installed.

[2024-05-07 16:49:04] ╭──────────── app build ───────────╼
[2024-05-07 16:49:04] │ ---> Node.js Buildpack
[2024-05-07 16:49:04] │ ---> Installing toolbox
[2024-05-07 16:49:04] │ ---> - jq
[2024-05-07 16:49:04] │ ---> - yj
[2024-05-07 16:49:05] │ ---> Getting Node version
[2024-05-07 16:49:05] │ ---> Resolving Node version
[2024-05-07 16:49:05] │ ---> Downloading and extracting Node v18.17.1
[2024-05-07 16:49:06] │ ---> Parsing package.json
[2024-05-07 16:49:06] │ ---> No file to start server
[2024-05-07 16:49:06] │ ---> either use 'docker run' to start container or add index.js or server.js
[2024-05-07 16:49:06] │ Project contains pnpm-lock.yaml, using pnpm
[2024-05-07 16:49:06] │ Installing node_modules using pnpm (from pnpm-lock.yaml)
[2024-05-07 16:49:06] │ unable to invoke layer creator
[2024-05-07 16:49:06] │ installing node_modules: exec: "pnpm": executable file not found in $PATH
[2024-05-07 16:49:06] │ ERROR: failed to build: exit status 1
[2024-05-07 16:49:06] │ 
[2024-05-07 16:49:06] │ 
[2024-05-07 16:49:06] │ For documentation on the buildpacks used to build your app, please see:
[2024-05-07 16:49:06] │ 
[2024-05-07 16:49:06] │    Node.js  v0.4.0  https://do.co/apps-buildpack-node
[2024-05-07 16:49:06] │ 
✘ build failed

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.