[BUG] Docker build error: Cannot find module '/app/main'
See original GitHub issueEnvironment
Windows 10 Enterprise
-
Hosting type
- [] Form.io
- Local deployment (Docker version 19.03.8, build afacb8b)
-
Formio.js version: 2.0.0-beta.4
Steps to Reproduce
- Install Docker tools. Enter formio directory
- From the terminal run, docker build -t dockerid/formio-server .
- Then run docker run -it --rm dockerid/formio-server
Expected behavior
Expected to see:
Initializing API Server.
> Mongo connection established.
> Serving the Form.io API Platform at http://localhost:3005
Observed behavior
internal/modules/cjs/loader.js:985
throw err;
^
Error: Cannot find module '/app/main'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
at Function.Module._load (internal/modules/cjs/loader.js:864:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Example:
Issue Analytics
- State:
- Created 3 years ago
- Comments:9
Top Results From Across the Web
Cannot find module for a node js app running in a docker ...
If your Dockerfile and package.json files are correct and still have the issue: Make sure you've rebuilt your container images. Try. docker-compose down...
Read more >Dockerized Node.js app Error: cannot find module - Compose
When I start a dockerized Node.js testapp with sudo docker-compose up I get the following error: Starting testapp_web_1 ... done Attaching ...
Read more >Deploy failed when running balena deploy - openBalena
[Info] Emulation is enabled [Debug] Found build tasks: [Debug] main: ... Cannot find module './rebuild' [Build] app at Function.Module.
Read more >module_not_found requirestack - You.com | The AI Search ...
Error: Cannot find module , code: 'MODULE_NOT_FOUND', requireStack: [] ... installed and have the correct version (if there is no folder, it will...
Read more >Get started with Kubernetes (using Python)
What we'll do · Get the code and run the application locally · Create an image and run the application in Docker ·...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @kidatsy , Thanks for the suggestion, I’ll try this out and revert shortly.
I think the problem in dockerfile. I tried to comment the WORKDIR and the error is just /main not /app/main. I guess ‘/main’ come from ENTRYPOINT in docker file