Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App starting and exiting: log error = enoent ENOENT: no such file or directory, open '/usr/src/app/package.json' #4

Closed
DatasoftSolutionsNet opened this issue Feb 10, 2024 · 1 comment

Comments

@DatasoftSolutionsNet
Copy link

DatasoftSolutionsNet commented Feb 10, 2024

Complete log is:

2024-02-10 14:44:17 npm ERR! code ENOENT
2024-02-10 14:44:17 npm ERR! syscall open
2024-02-10 14:44:17 npm ERR! path /usr/src/app/package.json
2024-02-10 14:44:17 npm ERR! errno -2
2024-02-10 14:44:17 npm ERR! enoent ENOENT: no such file or directory, open '/usr/src/app/package.json'
2024-02-10 14:44:17 npm ERR! enoent This is related to npm not being able to find a file.
2024-02-10 14:44:17 npm ERR! enoent
2024-02-10 14:44:17
2024-02-10 14:44:17 npm ERR! A complete log of this run can be found in:
2024-02-10 14:44:17 npm ERR! /home/node/.npm/_logs/2024-02-10T20_44_17_447Z-debug-0.log

This only happens when I uncomment the following lines in compose.yml
volumes:
- ./app:/usr/src/app
- /usr/src/app/node_modules

I'm running windows 10 with the latest docker desktop version
I'm also running docker desktop in Hyper-V mode, not WSL2
I added the folder to the file sharing list in Docker Desktop settings, but that doesn't seem to help.

Update: 2024-2-11:
Trying again today, and it's docker compose up is failing with the following message:
Error response from daemon: driver failed programming external connectivity on endpoint bindmount-apps-todo-app-1 (69390204732ab1e4407d01638e22663ab6a87223df018e682e695683cab239e4): Bind for 0.0.0.0:3001 failed: port is already allocated

@DatasoftSolutionsNet
Copy link
Author

DatasoftSolutionsNet commented Feb 11, 2024

After a lot of research, I ran into this solution...
docker/compose#4950 (comment)

So, in my case, I had in my compose.yml...

services:
   todo-app:
    build:
      context: ./app
    links:
      - todo-database
    volumes:
      - ./app:/usr/src/app
      - /usr/src/app/node_modules
    ports:
      - 3001:3001

I changed the ports: to

    ports: 3000

Then everything worked fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant