node.js - docker container exited with "Local package.json exists, but node_modules missing, did you mean to install?" message
问题描述
I'm trying to setup docker containers for fullstack app: express, react. But something goes wrong and api container doesn't work. Can you help me please https://github.com/flyoozes/react-full-stack
解决方案
when you specify volumes
in docker-compose.yml file it mounts folder when running container. And in your case docker overrides /srv/app/api
folder and as result node_modules
missing. You can comment out volumes
for api services and the container will work.
However is better to add /srv/app/api/node_modules
as 2nd volume to api
service. This will mount the node_modules
directory to the host machine using the buildtime directory.
推荐阅读
- process - 修改内核后:警告!UUID=xxxx 不存在
- c# - 使用位图将转换后的 HTML 的自动宽度和高度设置为图像
- autodesk-forge - Autodesk Forge 第三方更新程序对话框问题
- javascript - 遍历嵌套在对象内部的数组
- c# - 使用 Linq + MongoDb Driver 查询 UUID Key
- javascript - setTimeOut(function,time) 是否不断在函数堆栈上创建负载?
- database - 将 DocumentDB 复制到本地 mongo 服务
- r - 将 class(x) 设置为“environment”将属性设置为 NULL;结果将不再是 S4 对象
- python - 如何使用带有多个源列的 pandas_udf 将多个列添加到 pyspark DF?
- javascript - Javascript:“对象属性”实例的空构造函数名称