I configured a simple app in express to run in a docker container but whenever I make a change nodemon gives me an error saying that the port is already in use.
Error: listen EADDRINUSE: address already in use :::4000
That is my start script: nodemon -L --exec babel-node -- src/index
"nodemon": "^1.18.7"
and my index.js:
import express from 'express'
const app = express();
app.get("/", (req, res) => {
res.send("hello world");
});
app.listen(4000, () => console.log("The server is listening on port 4000"));
It's like it's not closing the process and it's trying to execute again
Can you provide a dockerfile? I don't use docker so I don't know how to run these things
It's simple @remy, I setup this for development only, I mounted the current directory with the container so it's mirrored and for that reason I don't need to copy the package.json or anything, just run yarn to install the packages and it will work just fine:
Dockerfile:
FROM node:11.2.0-alpine
WORKDIR /usr/src/app
RUN yarn
docker-compose.yml:
version: "3.7"
services:
server:
build: .
command: yarn start
ports:
- "4000:4000"
volumes:
- .:/usr/src/app
I noticed that it only works without babel-node, if I change:
import express from 'express'
to:
const express = require('express')
and use this as script:
"start": "nodemon -L src/index"
It works, it doesn't however when using --exec and babel-node
I'm having the same issue when running with docker-compose. However, adding --signal SIGINT to the nodemon command seems to fix it.
@richardkall I haven't tested the --signal yet, I will try it out. It would be nice to have this fixed by default, specially the legacy watch one, I'm having a lot of problems with it. Earlier today I was having a problem that nodemon was restarting over and over again the same file (I wasn't even changing anything in the file) and it was opening a lot of processes and it was crashing (freezing) my docker, it was really weird.
@zefexdeveloper Ah…you say "simple" like I'm supposed to know how docker works. What do I need to run those files? I've assumed docker for Mac, but how do I start it and test it?
@remy Oh, sorry, I thought you knew, my bad, that is why I said it's simple, because indeed the file is pretty simple.
You just have to have docker installed on your machine, create a folder with a Dockerfile (code above), create the docker-compose.yml (code above), a index.js file with the express and your package.json with nodemon installed.
You can run like this: docker-compose up
@richardkall I just tried using --signal and for some reason nodemon got stuck at:
[nodemon] restarting due to changes...
Weird, for me it's working with the --signal argument. Here's my setup, hopefully it can help in some way.
❯ docker-compose --version
docker-compose version 1.23.2, build 1110ad01
❯ docker --version
Docker version 18.09.0, build 4d60db4
./api/Dockerfile:
FROM node:10.13.0-alpine as base
WORKDIR /app
COPY package.json .
COPY yarn.lock .
RUN yarn --frozen-lockfile
COPY . .
docker-compose.yml:
version: '3.7'
services:
api:
build:
context: ./api
target: base
command: yarn dev
container_name: api
ports:
- 4000:4000
tty: true
volumes:
- /app/node_modules
- ./api:/app
web:
...
./api/package.json:
{
"engines": {
"node": "^10.13.0",
"yarn": "^1.10.1"
},
"scripts": {
"dev": "nodemon --signal SIGINT -e ts -x 'babel-node --extensions .ts' src"
},
"devDependencies": {
"@babel/node": "^7.0.0",
"nodemon": "^1.18.7",
...
}
}
@richardkall It's still not working for me, I noticed that you are not using the legacy watch, for me if I don't use nodemon doesn't work at all, specially now setting --signal even with the legacy watch it's not working either.
[nodemon] restarting due to changes...
[nodemon] restarting due to changes...
[nodemon] restarting due to changes...
btw: my settings are not that different from yours.
I'm facing the same issue. This has started after I upgraded from 1.18.4 to 1.18.7. I think it could be related to #1476.
Also I'm controlling the shutdown of my server with the approach described at https://github.com/remy/nodemon#controlling-shutdown-of-your-script but I don't seem to ever receive SIGUSR2.
One more thing, if I start and immediately change a file I can clearly see the logs of 2 servers starting, the first one with success and the second one failing due to EADDRINUSE. Quite clearly the process is not shutdown.
I've tried to debug but I can't seem to find much, not familiar with the nodemon codebase. @remy is there a build process if I change the source or I can just push the code to my fork and npm install from there?
To add some more details on this issue, I've been using nodemon to hot reload my API inside docker for the past 2 months. It was worked extremely well with no issues. After I upgraded I began to experience OPs issue.
docker-compose version 1.23.2, build 1110ad01
Docker version 18.09.0, build 4d60db4
Alpine 3.8
Node v8.11.4
Nodemon version 1.18.7
Modifying my command to use --signal SIGINT as suggested above didn't solve the issue.
However, I tested my API outside of docker with and without --signal SIGINT and it reloads correctly in both scenarios.
I can't debug much further right now but hopefully this bit of info can help.
I face the same issue and I believe somehow it is a Docker + nodemon --exec flag issue
In the following package.json, if you replace:
...
"start:dev": "nodemon --watch './src' --exec 'npm start'"
...
by:
...
"start:dev": "nodemon --watch './src'"
...
it works perfectly under docker.
Note that both work fine under OSX.
Here is the test case:
src/index.js
const express = require('express');
const app = express();
app.listen(17600, () => {
console.log('Server MediaStreamTrackAudioSourceNode, Olé !');
});
package.json
{
"name": "nodemon-test",
"version": "1.0.0",
"description": "",
"main": "./src/index.js",
"scripts": {
"start": "node .",
"start:dev": "nodemon --watch './src' --exec 'npm start'"
},
"author": "",
"license": "ISC",
"dependencies": {
"express": "^4.16.4"
},
"devDependencies": {
"nodemon": "^1.18.7"
}
}
Dockerfile
FROM node:10-alpine
WORKDIR /app
COPY ./src /app/src
COPY ./package.json /app/package.json
COPY ./package-lock.json /app/package-lock.json
RUN npm install
CMD [ "npm", "start" ]
docker-compose.yml
version: '3.7'
services:
node:
build: .
command: npm run start:dev
ports:
- 17600:17600
volumes:
- ./src:/app/src
- ./package.json:/app/package.json
Note: I need --exec because I pipe the output in the bunyan parser like this --exec 'npm start' | bunyan in real use case.
@OlivierCuyp see Nodemon inside a docker container requires the use of the legacy watch flag -L
However, even after I use legacy watch like OP my nodemon script does not correctly restart. I am also using --exec to pipe my nodemon watch to trigger a node-babel build.
I'm using nodemon the following way:
"dev": "nodemon --legacy-watch -w src --exec \"babel-node src --presets env,stage-0\"",
Let's wait for @remy to see what he has to say about that, the next steps.
@20k-ultra To my understanding under OSX docker is not using virtualbox with vboxsf since a long time so the -L to watch the filesystem is useless in this case.
I got no idea if it is still required on Windows though...
But this is not relevant to the issue since the -L is use to make sure nodemon catches the file changes and tries to restart.
Here it tries to restart but fail trying.
Same error using linux, docker, yarn and ts-node.
Dockerfile:
FROM node:8.11.3-alpine
...
CMD ["yarn", "run", "dev"]
package.json:
"scripts": {
"dev": "NODE_ENV=development nodemon --exec ts-node src/server.ts",
},
"devDependencies": {
....
"nodemon": "^1.18.7",
"ts-node": "^7.0.1",
...
Versions:
Alpine 3.8
Node v8.11.4
Nodemon version 1.18.7
Error in terminal:
...
server: [nodemon] restarting due to changes...
server: [nodemon] starting `ts-node src/server.ts`
server: Starting server...
server: Error: listen EADDRINUSE :::4000
...
But if I exec into the running container I can't find the blocking process:
docker-composer exec server sh
fuser 4000/tcp
# No Output
@tibotiber I tried to reinstall the version 1.18.4 but it didn't solve the issue.
But then I rollbacked to the version 1.12.1 and voilà ! I worked like a charm.
So as a temporary fix you can do:
npm rm nodemon
npm i [email protected] -D
Note: I didn't checked all versions between 1.12.1 and 1.18.4
@remy if you need help for testing let me know if I can do something.
@OlivierCuyp @spalberg @20k-ultra @tibotiber Try sharing your Dockerfile for development as well so we can test or help @remy or anyone else interesting in fixing this.
This issue is affecting my workflow so I'll try my best to be as helpful as possible!
Here's a repo I've made to make it very easy to reproduce the issue. Should be easy for new docker users to use as well.
@OlivierCuyp I'm surprised 1.18.4 even successfully installed, it had event-stream as deep dependency at a version which was compromised (see https://arstechnica.com/information-technology/2018/11/hacker-backdoors-widely-used-open-source-software-to-steal-bitcoin/) and has been pulled off npm. Good that rolling back helped, but do check your deep deps to be sure you don't have the malicious package (flatmap-stream) in there.
@zefexdeveloper here is my setup:
Dockerfile
FROM node:8-alpine
WORKDIR /usr/src/api
COPY package.json .
COPY yarn.lock .
RUN yarn install
COPY . .
EXPOSE 4000
CMD ["yarn", "start"]
docker-compose (parts)
api:
build:
context: ./api
restart: always
environment:
- [...]
ports:
- "${API_PORT}:3000"
volumes:
- "./api:/usr/src/api"
depends_on:
- mongo
yarn script
"start": "nodemon src/server.js --exec babel-node"
Note: I've moved to babel-watch due to this issue, that might help anybody stuck in their workflow (@20k-ultra)
To be honest with you guys I'm really considering not using Docker for development mostly because Docker volumes doesn't make a lot of sense for it anyway. It doesn't matter if your Dockerfile copy your package.json, install the dependencies, when you mount the volume the host files will override the container files anyway, and it might be even worse if your host is Windows and the container is using Linux, if a module needs compilation 100% sure you will have problems. Perhaps keep the development locally and use the containers for things like Postgres, NGINX, Redis and so on, at the end you might create a Dockerfile for your API and/or client in prod as you won't have the volume issues.
I'm open to suggestions, I might be wrong. Share your thoughts.
Nevermind, in resume you can use Docker for development, you just have to be sure you are mounting the right directory as volume, don't .:/usr/src/app (prefer ./src:/usr/src/app/src instead) because if you have packages that needs compilation it can be a mess. Your container might not be the same OS as your host. Instead mount the source directory and use the container node_modules.
@zefexdeveloper I posted a full test case up in the issue: here.
I made it as small as possible for fast test iteration.
The issue is really the nodemon --exec in Docker context.
For the dev Docker chat, we should find an other place to discuss it. I'll be glad to share my experience with it.
@tibotiber I check the npm auditresult after installing [email protected] only 2 low severity vulnerabilities and no sign of flatmap-stream
Hi guys.
I've tried to subscribe to all signals from this file "nodemon/lib/monitor/signals.js" inside my nodejs app running in docker. Then I ran nodemon in "verbose" mode and saw that "SIGHUP" signal was sent, but it wasn't delivered to my app inside docker. Looks like there is the root of evil.
PS: I don't have --exec parameter in my startup script. But I faced with the same issue.
PPS: 1.12.1 really works fine. Thank you @OlivierCuyp!
I have a feeling (though I'm on a mobile phone so it's not straight forward to confirm), that [email protected] was pre-chokidar which meant it used the find command to poll and watch (it's quite a long time ago, so I'm not 100% sure…
Any more digging you're able to do is definitely a help!
@remy don't think chokidar is the issue here. Since file changes are catched by nodemon.
The issue is after, the process not being killed for some reason (in Docker context).
Going the github releases I couldn't find the 1.12.1 version but I checked the package.json of the 1.12.3.
Chokidar was already there.
@GryaznovGI could you provide your startup script ?
@OlivierCuyp, I faced with this issue in my nodejs app. This app is running in docker.
I've used this script from my package.json during the last year without any problems:
"watch:nodemon": "nodemon --config ./scripts/configs/nodemon.json index.js",
This script is used in docker-compose configuration:
command: npm run watch:nodemon
It just starts my app through nodemon. No additional executables are used.
But since the last update to the version 1.18.7, it started to fail.
@OlivierCuyp Where can we continue the conversation regarding Docker for development?
@GryaznovGI what do you have in ./scripts/configs/nodemon.json ?
@zefexdeveloper on stackoverflow ?
@OlivierCuyp SO is horrible for that, to be honest. Here is a great Node.js Discord channel invitation, we can talk there and share information: https://discord.gg/KYDwUh
Also experiencing this issue
@remy I did more testing, the last version working with Docker is the 1.13.3.
Any idea on what change could have happened between 1.13.3 and 1.14.0 ?
@OlivierCuyp since it was working for me on 1.18.4, I'm wondering if it could come from a deep dependency instead. I've pasted the (minimal) diff to my yarn.log which introduced the bug. I had only upgraded nodemon in that change.
@@ -1067 +1067 @@ chardet@^0.7.0:
-chokidar@^2.0.2, chokidar@^2.0.3:
+chokidar@^2.0.3, chokidar@^2.0.4:
@@ -1086 +1086 @@ chokidar@^2.0.2, chokidar@^2.0.3:
-chownr@^1.0.1:
+chownr@^1.1.1:
@@ -1358 +1358 @@ [email protected], debug@~3.1.0:
-debug@^3.0.1:
+debug@^3.0.1, debug@^3.1.0:
@@ -1364,6 +1363,0 @@ debug@^3.0.1:
-debug@^3.1.0:
- version "3.2.5"
- resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.5.tgz#c2418fbfd7a29f4d4f70ff4cea604d4b64c46407"
- dependencies:
- ms "^2.1.1"
-
@@ -1482,4 +1475,0 @@ duplexer3@^0.1.4:
-duplexer@^0.1.1, duplexer@~0.1.1:
- version "0.1.1"
- resolved "http://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1"
-
@@ -1779,13 +1768,0 @@ etag@~1.8.1:
-event-stream@~3.3.0:
- version "3.3.6"
- resolved "https://registry.yarnpkg.com/event-stream/-/event-stream-3.3.6.tgz#cac1230890e07e73ec9cacd038f60a5b66173eef"
- dependencies:
- duplexer "^0.1.1"
- flatmap-stream "^0.1.0"
- from "^0.1.7"
- map-stream "0.0.7"
- pause-stream "^0.0.11"
- split "^1.0.1"
- stream-combiner "^0.2.2"
- through "^2.3.8"
-
@@ -2020,4 +1996,0 @@ flat-cache@^1.2.1:
-flatmap-stream@^0.1.0:
- version "0.1.0"
- resolved "https://registry.yarnpkg.com/flatmap-stream/-/flatmap-stream-0.1.0.tgz#ed54e01422cd29281800914fcb968d58b685d5f1"
-
@@ -2054,4 +2026,0 @@ [email protected]:
-from@^0.1.7:
- version "0.1.7"
- resolved "https://registry.yarnpkg.com/from/-/from-0.1.7.tgz#83c60afc58b9c56997007ed1a768b3ab303a44fe"
-
@@ -2122 +2091 @@ get-stream@^3.0.0:
- resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14"
+ resolved "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14"
@@ -2200 +2169,5 @@ got@^6.7.1:
-graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6:
+graceful-fs@^4.1.11, graceful-fs@^4.1.2:
+ version "4.1.15"
+ resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00"
+
+graceful-fs@^4.1.6:
@@ -3000,2 +2973,2 @@ lru-cache@^4.0.1:
- version "4.1.3"
- resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.3.tgz#a1175cf3496dfc8436c156c334b4955992bce69c"
+ version "4.1.5"
+ resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd"
@@ -3026,4 +2998,0 @@ map-obj@^2.0.0:
[email protected]:
- version "0.0.7"
- resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.0.7.tgz#8a1f07896d82b10926bd3744a2420009f88974a8"
-
@@ -3145,3 +3114,3 @@ minimist@^1.2.0:
-minipass@^2.2.1, minipass@^2.3.3:
- version "2.3.4"
- resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.4.tgz#4768d7605ed6194d6d576169b9e12ef71e9d9957"
+minipass@^2.2.1, minipass@^2.3.4:
+ version "2.3.5"
+ resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.5.tgz#cacebe492022497f656b0f0f51e2682a9ed2d848"
@@ -3152,3 +3121,3 @@ minipass@^2.2.1, minipass@^2.3.3:
-minizlib@^1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.1.0.tgz#11e13658ce46bc3a70a267aac58359d1e0c29ceb"
+minizlib@^1.1.1:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.1.1.tgz#6734acc045a46e61d596a43bb9d9cd326e19cc42"
@@ -3326,2 +3295,2 @@ nan@^2.9.2:
- version "2.11.0"
- resolved "https://registry.yarnpkg.com/nan/-/nan-2.11.0.tgz#574e360e4d954ab16966ec102c0c049fd961a099"
+ version "2.11.1"
+ resolved "https://registry.yarnpkg.com/nan/-/nan-2.11.1.tgz#90e22bccb8ca57ea4cd37cc83d3819b52eea6766"
@@ -3350,2 +3319,2 @@ needle@^2.2.1:
- version "2.2.3"
- resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.3.tgz#c1b04da378cd634d8befe2de965dc2cfb0fd65ca"
+ version "2.2.4"
+ resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.4.tgz#51931bff82533b1928b7d1d69e01f1b00ffd2a4e"
@@ -3395,2 +3364,2 @@ nodemon@^1.18.4:
- version "1.18.4"
- resolved "https://registry.yarnpkg.com/nodemon/-/nodemon-1.18.4.tgz#873f65fdb53220eb166180cf106b1354ac5d714d"
+ version "1.18.7"
+ resolved "https://registry.yarnpkg.com/nodemon/-/nodemon-1.18.7.tgz#716b66bf3e89ac4fcfb38a9e61887a03fc82efbb"
@@ -3398 +3367 @@ nodemon@^1.18.4:
- chokidar "^2.0.2"
+ chokidar "^2.0.4"
@@ -3402 +3371 @@ nodemon@^1.18.4:
- pstree.remy "^1.1.0"
+ pstree.remy "^1.1.2"
@@ -3452,2 +3421,2 @@ npm-packlist@^1.1.6:
- version "1.1.11"
- resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.1.11.tgz#84e8c683cbe7867d34b1d357d893ce29e28a02de"
+ version "1.1.12"
+ resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.1.12.tgz#22bde2ebc12e72ca482abd67afc51eb49377243a"
@@ -3562 +3531 @@ os-homedir@^1.0.0:
- resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3"
+ resolved "http://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3"
@@ -3574 +3543 @@ os-tmpdir@^1.0.0, os-tmpdir@~1.0.2:
- resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
+ resolved "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
@@ -3701 +3670 @@ path-is-absolute@^1.0.0:
- resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
+ resolved "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
@@ -3725,6 +3693,0 @@ path-type@^2.0.0:
-pause-stream@^0.0.11:
- version "0.0.11"
- resolved "http://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz#fe5a34b0cbce12b5aa6a2b403ee2e73b602f1445"
- dependencies:
- through "~2.3"
-
@@ -3868,6 +3830,0 @@ proxy-addr@~2.0.3:
-ps-tree@^1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/ps-tree/-/ps-tree-1.1.0.tgz#b421b24140d6203f1ed3c76996b4427b08e8c014"
- dependencies:
- event-stream "~3.3.0"
-
@@ -3882,5 +3839,3 @@ psl@^1.1.24:
-pstree.remy@^1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/pstree.remy/-/pstree.remy-1.1.0.tgz#f2af27265bd3e5b32bbfcc10e80bac55ba78688b"
- dependencies:
- ps-tree "^1.1.0"
+pstree.remy@^1.1.2:
+ version "1.1.2"
+ resolved "https://registry.yarnpkg.com/pstree.remy/-/pstree.remy-1.1.2.tgz#4448bbeb4b2af1fed242afc8dc7416a6f504951a"
@@ -4219 +4174 @@ safe-regex@^1.1.0:
- resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e"
+ resolved "http://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e"
@@ -4247 +4202 @@ semver-diff@^2.0.0:
-"semver@2 || 3 || 4 || 5", semver@>=1.1.0, semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.5.1:
+"semver@2 || 3 || 4 || 5", semver@>=1.1.0, semver@^5.4.1, semver@^5.5.1:
@@ -4254,0 +4210,4 @@ [email protected]:
+semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@^5.5.0:
+ version "5.6.0"
+ resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004"
+
@@ -4498,6 +4456,0 @@ split-string@^3.0.1, split-string@^3.0.2:
-split@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/split/-/split-1.0.1.tgz#605bd9be303aa59fb35f9229fbea0ddec9ea07d9"
- dependencies:
- through "2"
-
@@ -4541,7 +4493,0 @@ statuses@~1.4.0:
-stream-combiner@^0.2.2:
- version "0.2.2"
- resolved "http://registry.npmjs.org/stream-combiner/-/stream-combiner-0.2.2.tgz#aec8cbac177b56b6f4fa479ced8c1912cee52858"
- dependencies:
- duplexer "~0.1.1"
- through "~2.3.4"
-
@@ -4569 +4515 @@ string_decoder@~1.1.1:
- resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8"
+ resolved "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8"
@@ -4583 +4529 @@ strip-ansi@^3.0.0, strip-ansi@^3.0.1:
- resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
+ resolved "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
@@ -4599 +4545 @@ strip-eof@^1.0.0:
- resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf"
+ resolved "http://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf"
@@ -4652,2 +4598,2 @@ tar@^4:
- version "4.4.6"
- resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.6.tgz#63110f09c00b4e60ac8bcfe1bf3c8660235fbc9b"
+ version "4.4.8"
+ resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.8.tgz#b19eec3fde2a96e64666df9fdb40c5ca1bc3747d"
@@ -4655 +4601 @@ tar@^4:
- chownr "^1.0.1"
+ chownr "^1.1.1"
@@ -4657,2 +4603,2 @@ tar@^4:
- minipass "^2.3.3"
- minizlib "^1.1.0"
+ minipass "^2.3.4"
+ minizlib "^1.1.1"
@@ -4673 +4619 @@ text-table@^0.2.0, text-table@~0.2.0:
-through@2, through@^2.3.6, through@^2.3.8, through@~2.3, through@~2.3.4:
+through@^2.3.6:
@@ -4947,2 +4893,2 @@ widest-line@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-2.0.0.tgz#0142a4e8a243f8882c0233aa0e0281aa76152273"
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-2.0.1.tgz#7438764730ec7ef4381ce4df82fb98a53142a3fc"
@@ -5006,2 +4952,2 @@ yallist@^3.0.0, yallist@^3.0.2:
- version "3.0.2"
- resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.2.tgz#8452b4bb7e83c7c188d8041c1a837c773d6d8bb9"
+ version "3.0.3"
+ resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9"
I don't see anything stand out but hopefully this helps somebody see something.
@remy & @tibotiber
I think I found the issue looking at the 1.4.0 release:
https://github.com/remy/nodemon/commit/d15cf686f7b5cdc21d68dba98d88e77c0ee3ab79
The only change was the dependency from @remy/pstree to pstree.remy.
And a new version of pstree.remy was release 15 days ago
I tried to find more but I'll need the help of @remy for that
I'm just surprised by the npm behavior.
The version 1.18.4 did have a previous version 1.1.0 of pstree.remy.
See here:
But when I run npm i [email protected] still have the version 1.1.2 in my package-lock.json:
"pstree.remy": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.2.tgz",
"integrity": "sha512-vL6NLxNHzkNTjGJUpMm5PLC+94/0tTlC1vkP9bdU0pOHih+EujMjgMTwfZopZvHWRFbqJ5Y73OMoau50PewDDA=="
},
I though nodemon package-lock.json would have protected against this, weird ...
I can confirm @OlivierCuyp's issue, having the same [email protected] for [email protected].
I started digging further in the pstree and I found out that its package-lock.json isn't updated, it's pointing out the version 1.1.0 instead of 1.1.2.
https://github.com/remy/pstree/blob/master/package-lock.json#L3
Is there a fix for this yet?
@timini not a real one. For now, just use the version 1.13.3 all version after won't work.
Or if you use yarn you can add this in your package.json :
"resolutions": {
"nodemon/pstree.remy": "1.1.0"
}
As mention in https://github.com/remy/nodemon/issues/1484
Using v1.18.6, with the yarn resolution hack, works fine 👏
@timini no one has sent a PR yet, so no, not yet.
v1.18.6 with yarn resolution hack is not working for me with node:8.12-alpine docker image. Seems the SIGUSR2 is not triggered, perhaps a docker issue.
Basically: dupe of #1484 and it's in progress now - feel free to follow along there if you want to see how I fixed it.
Live fix in [email protected] (core change in pstree.remy…again).
@remy Thank you very much for the effort. I will be testing the changes today.
Just add --delay 300ms into the command solved my problem.
https://github.com/remy/nodemon#delaying-restarting
Anyone else from the future visiting this, I had to make sure my volume was mounted in docker-compose.yml to get nodemon to find the files.
Most helpful comment
I'm having the same issue when running with docker-compose. However, adding
--signal SIGINTto the nodemon command seems to fix it.