Can't deploy a NextJS app to the production


I can’t deploy a NextJS app to servers using the “fly deploy” command.

Here is the error

 => CANCELED [build 1/6] RUN apt-get update -qq &&     apt-get install -y build-essential pkg-config python-is-python3                                                                                                                                                                                                                                                23.9s
 => ERROR [build 2/6] COPY --link package-lock.json package.json ./                                                                                                                                                                                                                                                                                                    0.0s
 > [build 2/6] COPY --link package-lock.json package.json ./:
Error: failed to fetch an image or build from source: error building: failed to solve: failed to compute cache key: "/package-lock.json" not found: not found

Please help me.

The answer depends on which package manager you are using.

If you are using npm or are not sure, run:

npm install

If you are using yarn or pnpm, you will need to regenerate your Dockerfile:

npx dockerfiler

If, for some reason, that doesn’t work, try:

npx --yes @flydotio/dockerfile@latest

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