fly fails to build node.js app from source

Hi,
I get this error when running fly launch or fly deploy --local-only:

Error: failed to fetch an image or build from source: error building: failed to solve: failed to compute cache key: failed to calculate checksum of ref kepv7fevbzfdi23hb4pk2ofby::7sfjy8abfizlayay6fx3mt291: "/package-lock.json": not found

This indicates that your Dockerfile mentions package-lock.json (typically in a COPY statement), but no such file is present in your application. Running a command like npm install will create this file.

That is weird because I do have this file.
I can also see that package-lock.json was added to .dockerignore when I ran fly launch

Not sure where that came from, but you will want to remove package-lock.json from your .dockerignore if it is referenced by your Dockerfile.

Removing package-lock.json from .gitignore file solved the issue.
Now it works, thank you!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.