docker cloud上Angular 2上的net :: ERR_CONTENT_LENGTH_MISMATCH [英] net::ERR_CONTENT_LENGTH_MISMATCH on angular 2 on docker cloud
本文介绍了docker cloud上Angular 2上的net :: ERR_CONTENT_LENGTH_MISMATCH的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在docker cloud上运行angular 2时,我得到了net :: ERR_CONTENT_LENGTH_MISMATCH main.bundle.js,但是在我的本地docker实例上也可以使用
I am getting a net::ERR_CONTENT_LENGTH_MISMATCH main.bundle.js while running angular 2 on docker cloud ,the same however works on my local docker instance
以下是docker文件
The below is the docker file
FROM node
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY . /usr/src/app
RUN npm install
和docker组成
version: '2'
services:
app:
build: .
volumes:
- ./:/usr/src/app
ports:
- 4200:4200
- 49153:49153
command: npm start
关于为什么发生这种情况的任何线索都会有很大帮助
Any clue as to why this is happening will be of much help
推荐答案
在我更新了 node_modules 中的一个软件包之后,发生了我的事.可能与完整性/校验和有关的问题.解决方法是冲洗 node_modules 并运行
Happened to me after I updated one of the packages in node_modules. Probably integrity/checksum-related issue. The cure was to flush node_modules and run
$ npm install
.
这篇关于docker cloud上Angular 2上的net :: ERR_CONTENT_LENGTH_MISMATCH的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文