Question

When will App Platform work with npm workspaces?

When deploying multiple apps/components with App Platform from a monorepo using workspaces for each app, App Platform caches the root package.json file when it should also take into account the workspace’s package.json file too. When the workspace dependencies change they’re not installed because App Platform incorrectly thinks since the root dependencies haven’t changed that it’s safe to use the cached node_modules.

For now I’m stuck setting global env NODE_MODULES_CACHE=false.


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.

It sounds like App Platform isn’t properly handling workspace-specific dependencies in your monorepo and relies on the root package.json for caching. 🚧 Setting NODE_MODULES_CACHE=false is a workaround for now, but hopefully, App Platform improves its caching logic to account for workspace-level changes soon! ⚙️📦

Bobby Iliev
Site Moderator
Site Moderator badge
October 8, 2024

Hey @wakatime,

I don’t think that there are officially any plans for this, but this sounds like a great idea!

The best thing to do to get your voice heard regarding this would be to head over to our Product Ideas board and post a new idea, including as much information as possible for what you’d like to see implemented.

https://ideas.digitalocean.com/

- Bobby.

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.