nextjs-docker-pm2-nginx
nextjs-docker-pm2-nginx copied to clipboard
NextJs not building because of Typescriot.
Hello, thanks for this example. I'm trying to use at my NextJs with TypeScript project and i'm getting this error at NextJs build.
Error: It looks like you're trying to use TypeScript but do not have the required package(s) installed.
Log
PS D:\Jander Silva\Documents\GitHub\Pranc> docker compose up
[+] Building 124.3s (12/12) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 726B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 35B 0.0s
=> [internal] load metadata for docker.io/library/node:alpine 2.1s
=> [auth] library/node:pull token for registry-1.docker.io 0.0s
=> [1/7] FROM docker.io/library/node:alpine@sha256:993bdfb0da7ae8fa4dad7282f797e3e26e88f810d410e0b0409d132d1fb17af3 0.0s
=> [internal] load build context 0.2s
=> => transferring context: 3.31kB 0.0s
=> CACHED [2/7] WORKDIR /usr/app 0.0s
=> CACHED [3/7] RUN yarn add global pm2 0.0s
=> CACHED [4/7] COPY ./package.json ./yarn.lock ./ 0.0s
=> [5/7] RUN yarn add --dev typescript && yarn install --production 119.0s
=> [6/7] COPY ./ ./ 0.1s
=> ERROR [7/7] RUN yarn build 2.7s
------
> [7/7] RUN yarn build:
#12 0.693 yarn run v1.22.15
#12 0.743 $ next build
#12 1.934 info - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5
#12 2.163 Attention: Next.js now collects completely anonymous telemetry regarding usage.
#12 2.163 This information is used to shape Next.js' roadmap and prioritize features.
#12 2.163 You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
#12 2.163 https://nextjs.org/telemetry
#12 2.163
#12 2.342 info - Checking validity of types...
#12 2.353 It looks like you're trying to use TypeScript but do not have the required package(s) installed.
#12 2.353
#12 2.353 Please install typescript by running:
#12 2.353
#12 2.353 yarn add --dev typescript
#12 2.353
#12 2.353 If you are not trying to use TypeScript, please remove the tsconfig.json file from your package root (and any TypeScript files in your pages directory).
#12 2.353
#12 2.683 error Command failed with exit code 1.
#12 2.683 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
------
failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/sh -c yarn build]: exit code: 1