小编Mad*_*add的帖子

为什么运行 npm install 后 Docker 会卡住?

当我尝试使用 docker-compose 运行一些容器时,我遇到了问题。其中之一是 React 项目。问题是,当 docker 尝试构建 React 项目时,它构建得很好,没有任何问题,但是......它卡在构建过程的末尾,并且不继续 Dockerfile 的其他步骤。我对 Docker 还很陌生,所以我想我一定错过了一些东西,但对我来说似乎没问题。


我尝试过的:

在 React 项目的根目录(Dockerfile 所在的位置),我执行了“docker build”。它显示了这一点:

控制台输出:

Step 4/6 : RUN npm install --production
 ---> Running in 272b40588564
npm WARN deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated querystring@0.2.1: The querystring API is considered Legacy. new code should use the …
Run Code Online (Sandbox Code Playgroud)

freeze docker reactjs dockerfile npm-install

5
推荐指数
1
解决办法
6916
查看次数

标签 统计

docker ×1

dockerfile ×1

freeze ×1

npm-install ×1

reactjs ×1