简体   繁体   English

发生未处理的异常:找不到模块“@angular-devkit/build-angular”从“/project 到 docker

[英]An unhandled exception occurred: Could not find module “@angular-devkit/build-angular” from "/project into a docker

I am trying to got an image in docker on a way I could write docker-compose up --build and container works.我试图在 docker 中获得一个图像,我可以编写docker-compose up --build和容器工作。

But I am getting this error when I run docker-compose up after building the image:但是当我在构建映像后运行docker-compose up时出现此错误:

An unhandled exception occurred: Could not find module "@angular-devkit/build-angular" from "/project

I solved the problem the problem before by adding RUN npm install --save-dev @angular-devkit/build-angular in the Dockerfile but then other dependencies did not work.我通过在 Dockerfile 中添加RUN npm install --save-dev @angular-devkit/build-angular Dockerfile了这个问题,但是其他依赖项不起作用。

I think is a problem with the folders in docker but I do not know what I am missing.我认为 docker 中的文件夹有问题,但我不知道我缺少什么。

This is the Dockerfile :这是Dockerfile

FROM node:12.16.3

# Puerto entorno dev
EXPOSE 4200
# Puerto livereload
EXPOSE 49153
# Puerto Test
EXPOSE 9876
# Puerto e2e
EXPOSE 49152 

RUN apt update

# Instalamos angular cli en nuestra imágen
RUN npm install -g @angular/cli@8

RUN mkdir /project

COPY . /project/

WORKDIR /project

RUN npm install --yes

The docker-compose.yml file: docker-compose.yml文件:

version: '3.4'

services:
  client-angular:
    image: algoritmofifo
    build: .
    command: ng serve --host 0.0.0.0
    volumes:
      - .:/project  
    ports:
      - 4200:4200
      - 49153:49153
      - 9876:9876
      - 49152:49152
# add `/app/node_modules/.bin` to $PATH
ENV PATH /app/node_modules/.bin:$PATH

# install and cache app dependencies
COPY package.json /app/package.json
RUN npm install
RUN npm install -g @angular/cli@7.3.9

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 发生未处理的异常:无法从“/ang-frontend”找到模块“@angular-devkit/build-angular”。 使用 docker 和 docker-compose - An unhandled exception occurred: Could not find module "@angular-devkit/build-angular" from "/ang-frontend". with docker and docker-compose 发生未处理的异常:找不到模块“@angular-devkit/build-angular” - An unhandled exception occurred: Could not find module "@angular-devkit/build-angular" 发生未处理的异常:找不到 builder @angular-devkit/build-angular:dev-server 的实现 - An unhandled exception occurred: Could not find the implementation for builder @angular-devkit/build-angular:dev-server 无法从“/home/circleci/my-project”找到模块“@angular-devkit/build-angular” - Could not find module "@angular-devkit/build-angular" from "/home/circleci/my-project" 离子应用程序:发生未处理的异常:找不到模块“@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/utils” - Ionic app: an unhandled exception occurred: Could not find module “@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/utils” 发生未处理的异常:找不到模块 '@angular-devkit/build-angular/package.json' 需要堆栈: - An unhandled exception occurred: Cannot find module '@angular-devkit/build-angular/package.json' Require stack: 我收到此错误:发生未处理的异常:找不到模块'@angular-devkit/build-angular/package.json' 需要堆栈: - I get this error: An unhandled exception occurred: Cannot find module '@angular-devkit/build-angular/package.json' Require stack: Heroku 部署 - 发生未处理的异常:找不到模块“@angular-devkit/build-angular/package.json” - Heroku deploy - An unhandled exception occurred: Cannot find module '@angular-devkit/build-angular/package.json' 找不到模块“@angular-devkit/build-angular” - Could not find module "@angular-devkit/build-angular" 发生未处理的异常:找不到模块 'C:\\Users\\...\\node_modules\\@angular-devkit\\build-angular\\src\\dev-server' - An unhandled exception occurred: Cannot find module 'C:\Users\...\node_modules\@angular-devkit\build-angular\src\dev-server'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM