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.

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!