Trying to deploy to Digi Ocean App Platform - fails due to no package-lock.json

Hi all,

Not sure if anyone is using Digital Ocean’s app platform. I typically use AWS and have no issues deploying there. I thought I’d try out the DO App Platform. I’m deploying from Gitlab, but DO Deployment keeps failing due to no package-lock.json found in the repo.

I’m using NodeJS and Docker.

Any ideas?

I have done this once. But then there were some issues with App platform and our requirements, so moved to Caprover.

Did not have any issues with deployment. Although it was a PHP Wappler project.
In all the NodeJS apps that we have, we do commit the package-lock.json to the repository, do you not have it in the repo or App platform is throwing an error even though it is?

From my testing you should not run docker and you need to edit a file as stated here by George:

I think it works great!
Still trying to find out how to convert a docker project to non-docker…

Hey sid thanks for the reply. Yeah unfortunately there is no package-lock.json file in the local files to even commit it to the repo - that was the first thing I looked for

Ok thank you! I’ll try creating a non-docker target and see if that helps!

@George apologies to tag - but any guidance here on how to generate and include the appropriate package-lock.json file? I don’t really want to create a non-docker target if possible.

You just need to have a local NodeJS project without docker.

When it is setup the node modules will get installed and the package-lock.json will be automatically created.

Ok thank you.

I wish to continue working with Docker/Wappler on this new project.

So in theory would this work:
Create a second target that is a no-docker local target.
I continue working only in the Docker target, but I copy the no-docker targets package-lock.json file into the Docker targets files so that can be deployed?
Then I just need to always update the no-docker project with any updates I make in the Docker target.

Would that be ok?

I don’t think you will need to do this.
Once you create a local target, the node_modules & package files will be added to the main project.
Any changes you make, will also be directly available to all targets - except target specific stuff like DB connection details.

If by target, you actually meant Git Branch, in that case you are correct. You will have to copy over files from one branch to another with selective merging or just manual copy-paste. One time copy is fine, but it will be a nightmare to keep both in sync manually.

Thanks sid.

right now we have one target (brand new project). This was setup with Node/Docker.

What I’m considering doing is adding a second target, for the sake of the package-lock.json file. I won’t work on this target, but it will be a non-docker target.

So, if I do this - then the package-lock.json file will be created and used/deployed in the other targets in your opinion? If so - then that sounds like the right solution.

The package-lock.json will be created in the project. But it will not be used in Docker target.
This is the primary reason why it does not exist for you - it is not required for Docker deployment.

With the file created and committed to your Gitlab repo, DO App Platform will deploy the app from this.
It does not take into account any of the docker files in the repo from what I understand (not 100 % sure about this one), and uses its own method to deploy an application.

In conclusion, adding second target and commit changes should help with the package-lock.json file error.

1 Like

Thank you sid. I’ll do some testing and report back!

Did some testing on the project unfortunately I kept getting failures when trying to install node on the non-docker target for the purpose of testing / creating the package-lock.json file.

I’m not sure if this info is valuable to you, I can recreate and send the log @George if you like but I assume it’s due to me being on an M1.

I’ll stick with AWS for now as that worked without issues on previous projects.

Matt