devchop2 / dev-techHub

0 stars 0 forks source link

docker-compose build ERR : The engine "node" is incompatible with this module. Expected version "^18.13.0 || >=20.9.0". Got "16.20.1" #1

Closed devchop2 closed 2 hours ago

devchop2 commented 3 hours ago
rina@RINAui-MacBookPro-2 backend % docker-compose up --build
WARN[0000] /Users/rina/Projects/dev-techHub/backend/docker-compose.yaml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion 
[+] Building 17.2s (9/10)                                                                                                                                                         docker:desktop-linux
 => [server-computer internal] load build definition from dockerFile.graphql                                                                                                                      0.0s
 => => transferring dockerfile: 197B                                                                                                                                                              0.0s
 => [server-computer internal] load metadata for docker.io/library/node:16.20.1                                                                                                                   1.8s
 => [server-computer internal] load .dockerignore                                                                                                                                                 0.0s
 => => transferring context: 2B                                                                                                                                                                   0.0s
 => CACHED [server-computer 1/6] FROM docker.io/library/node:16.20.1@sha256:6cd6581a9ae814ebbc8077afd63ecbf4d37f9b59ac9d9304a1b5a9e743ac13e0                                                      0.0s
 => [server-computer internal] load build context                                                                                                                                                 3.0s
 => => transferring context: 184.55MB                                                                                                                                                             3.0s
 => [server-computer 2/6] COPY ./package.json /techHub/                                                                                                                                           0.3s
 => [server-computer 3/6] COPY ./yarn.lock /techHub/                                                                                                                                              0.0s
 => [server-computer 4/6] WORKDIR /techHub/                                                                                                                                                       0.0s
 => ERROR [server-computer 5/6] RUN yarn install                                                                                                                                                 12.0s
------                                                                                                                                                                                                 
 > [server-computer 5/6] RUN yarn install:                                                                                                                                                             
0.315 yarn install v1.22.19
0.397 [1/4] Resolving packages...
0.614 [2/4] Fetching packages...
11.66 warning lru.min@1.1.1: The engine "bun" appears to be invalid.
11.66 warning lru.min@1.1.1: The engine "deno" appears to be invalid.
11.66 error @angular-devkit/core@17.3.8: The engine "node" is incompatible with this module. Expected version "^18.13.0 || >=20.9.0". Got "16.20.1"
11.67 error Found incompatible module.
11.67 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

When I ran the docker-compose up --build command, I encountered the following error. I set up NestJS using the npx command.

devchop2 commented 2 hours ago

I resolved it by upgrading node version in dockerFile.graphql like this,

FROM node:20.9.0 ##upgrade node to 20.9.0

COPY ./package.json /techHub/
COPY ./yarn.lock /techHub/
WORKDIR /techHub/
RUN yarn install
COPY . /techHub/

CMD yarn start:dev