Answer the question
In order to leave comments, you need to log in
How to do NPM install when building docker image for build in gitlab ci?
Automated node.js build in .gitlab-ci.yml in this way:
build:
stage: build
image: trion/ng-cli:latest
script:
- npm ci --loglevel verbose
- ng build --prod --aot --output-hashing=all --serviceWorker
artifacts:
expire_in: 60 minutes
paths:
- ./dist/webpp
interruptible: true
tags:
- docker
only:
- stage
FROM trion/ng-cli:latest
COPY package.json package-lock.json angular.json ./
RUN npm install && npm install --loglevel verbose
build:
stage: build
image: имя образа
script:
- ng build --prod --aot --output-hashing=all --serviceWorker
artifacts:
expire_in: 60 minutes
paths:
- ./dist/webpp
interruptible: true
tags:
- docker
only:
- stage
An unhandled exception occurred: Cannot find module '@angular-devkit/build-angular/package.json'
FROM node:latest
COPY package.json package-lock.json angular.json ./
RUN npm install && npm install @angular-devkit/build-angular --loglevel verbose
Answer the question
In order to leave comments, you need to log in
You can cache node_modules .
Gitlab CI Discussion : npm doesn't like the cached node_modules
pnpm is faster npm can use it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question