The issue is simple, npm
doesn't know about ng.
> store-web@0.0.0 build /App
> ng build
[91msh: 1: ng: not found
[0m[91mnpm ERR! code[0m[91m ELIFECYCLE
[0m[91mnpm[0m[91m ERR! syscall spawn
npm[0m[91m ERR! file sh
[0m[91mnpm ERR! [0m[91merrno ENOENT
[0m[91mnpm ERR! store-web@0.0.0 build: `ng build`
npm[0m[91m ERR! spawn ENOENT
npm [0m[91mERR!
npm ERR! Failed at the store-web@0.0.0 build script.
npm[0m[91m [0m[91mERR! This is probably not a problem with npm. There is likely additional logging output above.
[0m[91m
npm ERR! A complete log of this run can be found in:
[0m[91mnpm ERR![0m[91m /root/.npm/_logs/2024-02-27T09_13_42_130Z-debug.log
[0mThe command '/bin/sh -c npm run build --prod' returned a non-zero code: 1
Workspaces for OM Dashboard Angular Pipeline(S3 Prod) Docker-ECR #95
FROM node:14.16.1 as source
WORKDIR /App
COPY /package.json .
RUN npm install
COPY /. .
RUN npm run build --prod
FROM nginx:alpine
COPY --from=source /App/dist/StoreWeb /usr/share/nginx/html
EXPOSE 80
Then, I tried to install angular/cli with dockerfile. But I ask for version 18.0.2.
FROM node:14.16.1 as source
WORKDIR /App
COPY /package.json .
RUN npm install -g @angular/cli@latest
RUN npm install
COPY /. .
RUN npm run build --prod
FROM nginx:alpine
COPY --from=source /App/dist/StoreWeb /usr/share/nginx/html
EXPOSE 80
npm install -g @angular/cli@latest