Question

'Apps' always builds Node app with cache node_modules despite changes to package.json

Hello -

I am new to the Digital Ocean Apps platform and I am having an issue related to when the instance begins building my Node application. The issue is related to previously cached node_modules during the build process. I have added a few modules but builds via DO do not reflect these module changes, as DO continues to use a cached version of node_modules (as seen in the logs, I believe related to Docker and Buildpack?). The package-lock.json is checked in, but I am unsure if this would resolve the issue or not.

How do I clear this cache to ensure the DO environment does not use cached assets?

Show comments

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.

Kamal Nasser
DigitalOcean Employee
DigitalOcean Employee badge
December 21, 2020
Accepted Answer

👋🏼 @JohnFoderaro

Looking at your app’s build logs, it seems to be using Yarn instead of NPM to install dependencies. If a yarn.lock file exists, App Platform will use Yarn, even if a package-lock.json file exists.

Make sure you commit the dependency updates to yarn.lock or remove it entirely if you don’t need it. This will invalidate the existing cache and install the right dependencies. Let me know if that works!

Try DigitalOcean for free

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

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

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

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel