question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[nodemon] Internal watch failed: Circular symlink detected

See original GitHub issue
  • nodemon -v: 2.0.5
  • node -v: 12.19.0
  • Operating system/terminal environment:
  • Using Docker? What image: node:lts-alpine
  • Command you ran: CMD [“nodemon”, “–config”, “/app/src/ScheduleService-nodemon.json”, “/app/src/ScheduleService/index.js”]

Before this hell started, Nodemon was working fine. I have deleted all Docker images and caches and re-build everything from scratch. So the versions should be the latest.

Expected behaviour

Nodemon should be monitoring files without issues.

Actual behaviour

Nodemon reports an error: … [nodemon] Internal watch failed: Circular symlink detected: “/sys/class/cpuid/cpu0/subsystem” points to “/sys/class/cpuid” … [nodemon] Internal watch failed: Circular symlink detected: “/sys/class/bdi/0:85/subsystem” points to “/sys/class/bdi” …

Steps to reproduce

Start the image.


If applicable, please append the --dump flag on your command and include the output here ensuring to remove any sensitive/personal details or tokens.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:21 (4 by maintainers)

github_iconTop GitHub Comments

29reactions
dougecompcommented, Nov 6, 2020

I am running a nodejs application inside a docker container.

I solved creating a nodemon.json on my project root with this content:

{
  "watch": ["src"],
  "ext": "js"
}

The watch option only update when anything on my src folder changes. Without it, nodemon watches all files of the system, generating the error. Maybe a possible fix is to make nodemon observe by default the files on current directory and subdirectories.

5reactions
haydenlindercommented, Jan 2, 2021

Okay I just solved this, although tbh I am not exactly sure what caused the issue in the first place. Seems to be a Docker configuration issue though, not an issue with nodemon.

  1. Change dockerfile like so:
 FROM node:14.15.0
 # add this line
 WORKDIR /app 
 # change second '.' to '/app'
 COPY . /app 
 RUN npm install 
 CMD npm run dev
  1. Build the image and then run it in a container with interactive terminal (optional), mounting a volume from the current host directory (pwd) to the WORKDIR (/app) in the container:
docker build -t imagename:tag .
docker run -it -p 1234:1234 -v $(pwd):/app imagename:tag

Or, with docker-compose.yml

version: '3.6'
services:
  server:
    build: .
    volumes:
    - .:/app
    ports:
    - "3000:3000"

Then run

docker-compose up --build
Read more comments on GitHub >

github_iconTop Results From Across the Web

Docker Container npm ERR! Internal watch failed
This answer is from Github issue. It is really similar to your problem. [Github Issue] Internal watch failed: Circular symlink detected.
Read more >
[nodemon] Internal watch failed: Circular symlink detected
Internal watch failed : Circular symlink detected · Expected behaviour. Nodemon should be monitoring files without issues. · Actual behaviour.
Read more >
[Solved]-Docker Container npm ERR! Internal watch failed
This answer is from Github issue. It is really similar to your problem. [Github Issue] Internal watch failed: Circular symlink detected · [Original...
Read more >
erro npm nodemon | Rest com NodeJS
[nodemon] watching extensions: js,mjs,json [nodemon] starting `node index.js` [nodemon] Internal watch failed: Circular symlink detected: ...
Read more >
Bug listing with status RESOLVED with resolution OBSOLETE ...
Kernel Log: "ACPI: EC: GPE storm detected, transactions will use polling mode"" ... Bug:369463 - "gpe-utils/gpe-clock fails because of underlinking" ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found