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
17
votes
10 answers

nodemon ''mocha' is not recognized as an internal or external command, operable program or batch file

Running a test for a nodejs project on windows 10 with the line in package.json as: "test": "nodemon --exec 'mocha -R min'" I get: > nodemon --exec 'mocha -R min' [nodemon] 1.11.0 [nodemon] to restart at any time, enter `rs` [nodemon]…
MToma
  • 549
  • 1
  • 5
  • 9
17
votes
4 answers

Sync code changes in electron app while developing

Are there any tools to live reload electron app when code is changed similar to browser-sync for web? Whenever we change code for electron app, I am terminating existing running process and relaunching with electron . Are they any tools to reload…
Sathya Vikram
  • 325
  • 1
  • 2
  • 9
17
votes
1 answer

How do I monitor symlinked modules with Nodemon?

I’m developing a module in Node.js which I’ve npm-linked into another projects node_modules folder. I’d like to restart this other projects server upon file changes in my module. Nodemon ignores node_modules by default, but I assumed I could…
Victor Nystad
  • 171
  • 1
  • 3
16
votes
4 answers

The 'mode' option has not been set, webpack will fallback to 'production' for this value.Field 'browser' doesn't contain a valid alias configuration

Project directory structure. Below are the webpack configuration files. webpack.config.client.js const path = require('path'); const webpack = require('webpack'); const CURRENT_WORKING_DIR = process.cwd(); const config = { name: 'browser', …
16
votes
2 answers

Run script on change in nodemon

Is it possible to run a script on change using nodemon? Is it possible to do something like this: nodemon --watch src --exec yarn run my-script? So, ideally I'd like to run a script only when there're changes in a src folder
Le garcon
  • 7,197
  • 9
  • 31
  • 46
16
votes
1 answer

WebSockets request was expected error when using --inspect-brk option

When I run nodemon dist/server/app.js it works on default port 3000 and I'm able to reach my API. But if I run nodemon --inspect-brk=localhost:3000 dist/server/app.js I got error WebSockets request was expected What's wrong?
ycshao
  • 1,768
  • 4
  • 18
  • 32
15
votes
6 answers

How to install nodemon Nodejs on macOS? nodemon keeping show : command not found

Currently I already install nodemon with command npm install -g nodemon. And I got Permissions issue, so I do command with sudo npm install -g nodemon and i did it. But when I make "nodeman" command was always show nodemon: command not found.
Slamet Riyadi
  • 203
  • 1
  • 2
  • 6
15
votes
6 answers

nodemon, babel-node: how to set environment variable?

Dev environment starts with this command: nodemon -w src --exec \"babel-node src --presets es2015,stage-0\" How do i create a global variable (or process.env variable) __DEV__ = true?
stkvtflw
  • 12,092
  • 26
  • 78
  • 155
14
votes
2 answers

How can nodemon be made to work with WSL 2?

Ever since updating from WSL 1 to WSL 2 with the Windows 10 April 2020 update (and thereafter updating Ubuntu 18 to Ubuntu 20), I have not been able to get nodemon to hot reload when there are file changes in the project's directory. When I make any…
Raj
  • 1,479
  • 3
  • 15
  • 29
14
votes
2 answers

Use nodemon with docker and docker-compose

I'm using nodemon with docker-compose. Here is my Dockerfile: FROM node:10 WORKDIR /usr/src/app COPY package*.json ./ RUN npm install COPY . . CMD ["npm", "start"] My docker-compose.yml version: '3' services: app: build: . volumes: …
14
votes
20 answers

Nodemon stuck at "restarting due to changes..." and won't restart the server

I have a pretty basic nodemon configuration. I'm fixing this legacy node 7 project that I inherited and trying to make the development process a little bit painful. First thing first, a proper restart-and-transpile process (since it's built using…
Christopher Francisco
  • 15,672
  • 28
  • 94
  • 206
14
votes
4 answers

Nodemon inside docker container

I'm trying to use nodemon inside docker container: Dockerfile FROM node:carbon RUN npm install -g nodemon WORKDIR /usr/src/app COPY package*.json ./ RUN npm install COPY . . EXPOSE 8080 CMD [ "nodemon" ] Build/Run command docker build -t tag/apt…
Jumpa
  • 4,319
  • 11
  • 52
  • 100
14
votes
1 answer

single quotes not working in package.json

I'd like to get my package.json to be able to run using the command npm run test-watch on Windows 10 with npm 5.5.1. In my package.json: "scripts": { "test": "mocha server/**/*.test.js", "test-watch": "nodemon --exec 'npm test'" …
Rik
  • 1,870
  • 3
  • 22
  • 35
14
votes
5 answers

How to kill nodemon process on mac?

I am having trouble with exiting past nodemon instance. COMMAND   PID USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME node    98355 user   14u  IPv6 0x51b8b9857a4e56a3      0t0  TCP *:redwood-broker (LISTEN) It has taken my 3000 port so I am…
Barak Shirali
  • 151
  • 1
  • 1
  • 5
14
votes
3 answers

how to do linting using nodemon?

Can I use nodemon to lint my javascript? I am not using any build tool e.g. gulp or grunt and want to maximize the use of node and npm. The output from nodemon can be piped. I want to use this for linting the changed file using eslint. Here is my…
DrEarnest
  • 853
  • 2
  • 13
  • 27