I have this error on angular docker project:
industrialareas_angular_ctnr | This version of CLI is only compatible with Angular versions ^13.0.0-next || >=13.0.0 <14.0.0,
industrialareas_angular_ctnr | but Angular version 12.2.16 was found instead.
My Dockerfile-angular file is:
FROM node:14
WORKDIR /usr/src/app
RUN npm uninstall -g @angular/cli
RUN npm uninstall @angular/cli
RUN npm i @angular/[email protected]
RUN npm cache clean --force
COPY ./project/package*.json .
RUN npm install
RUN npm link @angular/cli
COPY ./project .
EXPOSE 4200
CMD npm start
My docker-compose.yml file is:
version: '3.7'
services:
angular:
container_name: industrialareas_angular_ctnr
build:
context: .
dockerfile: Dockerfile-angular
restart: unless-stopped
volumes:
- ./project/src:/usr/src/app/src
ports:
- 4200:4200
And the package.json file is:
...
"dependencies": {
...
"@angular/core": "~12.2.0",
...
},
"devDependencies": {
...
"@angular/cli": "~12.2.8",
...
I have checked compatibility versions on this link
Anybody could help me please ? Thanks in advance.
ng --versioncommand? Maybe@angular/cliis installed globally and its version is higher than12.2.8.node_modulestree in thedocker-compose.yml?