Я пытался добавить свое приложение angular6 в среду docker-compose
.Я создал проект локально, и он работает, но после docker-compose build
и docker-compose up
он отправляет следующую ошибку:
angular6@0.0.0 start /usr/src/app
> ng serve --host 0.0.0.0 --disable-host-check -p 3000
Could not find module "@angular-devkit/build-angular" from "/usr/src/app".
Error: Could not find module "@angular-devkit/build-angular" from "/usr/src/app".
at Object.resolve (/usr/local/lib/node_modules/@angular/cli/node_modules/@angular-devkit/core/node/resolve.js:141:11)
at Observable.rxjs_1.Observable [as _subscribe] (/usr/local/lib/node_modules/@angular/cli/node_modules/@angular-devkit/architect/src/architect.js:132:40)
at Observable.subscribe (/usr/local/lib/node_modules/@angular/cli/node_modules/rxjs/internal/Observable.js:162:69)
at DoOperator.call (/usr/local/lib/node_modules/@angular/cli/node_modules/rxjs/internal/operators/tap.js:71:23)
at Observable.subscribe (/usr/local/lib/node_modules/@angular/cli/node_modules/rxjs/internal/Observable.js:159:22)
at /usr/local/lib/node_modules/@angular/cli/node_modules/rxjs/internal/util/subscribeTo.js:22:31
at Object.subscribeToResult (/usr/local/lib/node_modules/@angular/cli/node_modules/rxjs/internal/util/subscribeToResult.js:7:45)
at MergeMapSubscriber._innerSub (/usr/local/lib/node_modules/@angular/cli/node_modules/rxjs/internal/operators/mergeMap.js:132:38)
at MergeMapSubscriber._tryNext (/usr/local/lib/node_modules/@angular/cli/node_modules/rxjs/internal/operators/mergeMap.js:129:14)
at MergeMapSubscriber._next (/usr/local/lib/node_modules/@angular/cli/node_modules/rxjs/internal/operators/mergeMap.js:112:18)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! angular6@0.0.0 start: `ng serve --host 0.0.0.0 --disable-host-check -p 3000`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular6@0.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
angular-ayaresa |
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-05-23T10_03_17_591Z-debug.log
Это мой Angular Dockerfile:
# Create image based on the official Node 8.10.0 image from dockerhub
FROM node:8.10.0
# Create a directory where our app will be placed
RUN mkdir -p /usr/src/app
# Change directory so that our commands run inside this new directory
WORKDIR /usr/src/app
# Copy dependency definitions
COPY ./quickstart /usr/src/app
# Install dependecies
RUN rm -rf node_modules/
RUN npm i --save
RUN npm i npm@latest -g
RUN npm install -g @angular/cli
# Expose the port the app runs in
EXPOSE 4200
# Serve the app
CMD ["npm", "start"]
Модуль@angular-devkit/build-angular
был правильно установлен и включен в package.json