Questions tagged [nodemon]

nodemon is an automated process that monitors the directory for a given node application. When files change in this directory, nodemon automatically restarts the node application.

nodemon is an automated process that monitors the directory for a given node application. When files change in this directory, nodemon automatically restarts the node application.

Basic usage

nodemon [your node app]
nodemon ./server.js localhost 8080
1355 questions
10
votes
3 answers

How to use nodemon with JSX?

I can compile and run my JSX app with one command: jsx app.jsx | node But I also want my server to automatically restart every time I modify app.jsx. I can do that with nodemon, but I can't quite figure out how to get nodemon to run my script…
mpen
  • 272,448
  • 266
  • 850
  • 1,236
10
votes
1 answer

Nodemon --ext any file type

I have an images directory that I want to watch. The directory can have many different file types. I know you can specify a list of file types for nodemon to watch, but how can I tell nodemon to watch ALL files in a directory? My command looks like…
ritmatter
  • 3,448
  • 4
  • 24
  • 43
9
votes
2 answers

Do I need nodemon in production?

When working locally on a NodeJS project, nodemon is required in order to make the coding easier. I frequently see the cases when it's installed as a dev-dependency only, so I wonder: what is the correct approach when it comes to deployment? Should…
delux
  • 1,694
  • 10
  • 33
  • 64
9
votes
1 answer

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function. Received undefined in nodejs

Hi Guys am new in node js , i am getting an error when am trying to append my file in node js don't know what's going on wrong please try to fix my error and also tell me what should i do? console.log("Starting app.js"); const fs =…
user13427179
9
votes
5 answers

Nodemon doesn't reload in docker container when files change

I read many threads sabout this but no one solves anything. Some say you have to add --legacy-watch (or -L) to the nodemon command. Others shows several different configurations and apparently nodody really knows what you gotta do to achieve…
Marcos Di Paolo
  • 527
  • 1
  • 5
  • 22
9
votes
6 answers

How to properly restart nodemon server

When I run a nodejs server with the following command: "start": "nodemon --max-old-space=8192 ./src/app.js --exec babel-node" and I change anything in the code, nodemon automatically reloads the code and restarts the server with the following…
KasparTr
  • 2,328
  • 5
  • 26
  • 55
9
votes
7 answers

How to use nodemon with express js while npm start?

I want to use nodemon to automatically detect changes in my scripts in node.js project and restart when change detected. I have my project setup using express.js. How to use nodemon with express.js, so that when i type npm start, nodemon initiates…
Abhishek Rathore
  • 1,016
  • 1
  • 11
  • 13
9
votes
7 answers

Nodemon not working anymore . Usage: nodemon [nodemon options] [script.js] [args]

nodemon always worked for me. I always did nodemon server and it would run the server file and watch for updates and node would restart. But now when I do it, I get this in the cmd (I use windows): Usage: nodemon [nodemon options] [script.js]…
jack blank
  • 5,073
  • 7
  • 41
  • 73
9
votes
4 answers

Heroku failing to start my node app because its trying to do it with nodemon

I'm deploying my node app to Heroku and it's trying to invoke it with nodemon rather than the node app.js I have defined. My Procfile looks like this: web: npm start And when I push to heroku the dyno crashes with this…
Andrew Lavers
  • 8,023
  • 1
  • 33
  • 50
9
votes
5 answers

automatically reloading Koa server

I've started playing around with Koa, but so far have been unable to find a decent solution for automatically reloading the application upon code changes. My understanding is that nodemon is the preferred solution in the Node universe, but I'm…
AnC
  • 4,099
  • 8
  • 43
  • 69
9
votes
1 answer

Node.js spawns multiple processes

I got a little bit confused about my node.js application. As far as I thought, node.js runs in a single process. However if I start my application by invoking node app.jsand monitor it with htop, I can see 4 sub-processes running, where I'd expect…
Alx
  • 6,275
  • 7
  • 32
  • 54
8
votes
3 answers

Nodemon and webpack-dev-server hot reload not working under WSL 2 after Windows 10 resinstall

A few days ago I re-installed Windows 10. I am developing full stack web app with express as backend and React.js as frontend. I am using nodemon to realod the server and webpack-dev-server for the frontend. Worth mentioning is that I am using WSL2.…
8
votes
1 answer

Nodemon execute different scripts based on the changed file name

I am trying to make Nodemon run two different commands depending on which file changed. I tried using nodemon.json and invoking it using nodemon nodemon.json (because it didn't seem to be getting picked up just by nodemon): { "watch":…
Tomáš Hübelbauer
  • 9,179
  • 14
  • 63
  • 125
8
votes
1 answer

How to run ECMAScript (mjs files) with nodemon?

I am able to run mjs files with nodejs using --experimental-modules flag. node --experimental-modules index.mjs package.json: { "name": "mjs-tests", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { …
boleeluchshiy
  • 121
  • 1
  • 1
  • 9
8
votes
0 answers

import express from 'express'; SyntaxError: Unexpected identifier

I've been making a script via tutorial, but when I'm trying to run index.js via nodemon run index.js, I get syntax error in pointing to import express from 'express'; . I have nodemon installed, for bd I've also have mongo and mongod running.…
Ari
  • 115
  • 1
  • 3
  • 8