nodemon

Nodemon restart twice when change is made

安稳与你 提交于 2020-01-06 11:47:33
问题 I am using nodemon in order to restart the app when change is made. It works good however it restart two times and thus sometimes it is a bit busy to read data returned from server (like console.log) since its reloaded twice. I am talking about something like this: [nodemon] starting `node app.js` Connected to db and listening on port 8080 [nodemon] restarting due to changes... [nodemon] starting `node app.js` Connected to db and listening on port 8080 I am working with Atom IDE. If this

What is the reason for nodemon working in cmd but not in a batch file?

♀尐吖头ヾ 提交于 2020-01-06 05:37:27
问题 I am in the process of making a discord bot. All of the code that I have written for the bot works except for the batch file that is supposed to run it. Originally I was just using the node command and when I opened cmd, navigated to the folder, and typed it manually it worked fine, but when I put that same code into a batch file it gave me this error: 'node' is not recognized as an internal or external command, operable program or batch file. This is all the code for that batch file: @echo

Deploying node app on heroku firing errors related to nodemon

廉价感情. 提交于 2019-12-24 11:22:46
问题 I am trying to run my node app in heroku but I am getting this error which is related to nodemon dependency. 2018-12-16T21:32:51.891208+00:00 app[web.1]: sh: 1: nodemon: not found 2018-12-16T21:32:51.895084+00:00 app[web.1]: npm ERR! file sh 2018-12-16T21:32:51.895380+00:00 app[web.1]: npm ERR! code ELIFECYCLE 2018-12-16T21:32:51.895627+00:00 app[web.1]: npm ERR! errno ENOENT 2018-12-16T21:32:51.895865+00:00 app[web.1]: npm ERR! syscall spawn 2018-12-16T21:32:51.896987+00:00 app[web.1]: npm

gulp nodemon + node = Error: listen EADDRINUSE

。_饼干妹妹 提交于 2019-12-24 11:05:01
问题 I know EADDRINUSE happens when node tries to bind itself to a port that's already in use. The problem is that this all worked in combination with gulp nodemon to restart when changes occur in my code. I have a feeling I'm getting this error, ever since I moved my code from bin/www into my app.js file. bin/www looks like this: #!/usr/bin/env node var app = require('../app'); gulp.js restarts my server with this code: // nodemon task gulp.task('nodemon', function(){ nodemon({ script: 'bin/www',

Grunt won't load the node server

六眼飞鱼酱① 提交于 2019-12-24 10:58:49
问题 My gruntfile.js is: 'use strict'; module.exports = function(grunt) { // Project Configuration grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), watch: { jade: { files: ['app/views/**'], options: { livereload: true, }, }, js: { files: ['gruntfile.js', 'server.js', 'app/**/*.js', 'public/js/**', 'test/**/*.js'], tasks: ['jshint'], options: { livereload: true, }, }, html: { files: ['public/views/**'], options: { livereload: true, }, }, css: { files: ['public/css/**'], options: {

nodemon not refreshing when using typescript

♀尐吖头ヾ 提交于 2019-12-23 16:43:20
问题 I'm working on an app with NodeJs, express, typescript and nodemon. But the page is not refreshed when I changed some code in the ts files. How can I do to compile the ts file in js and refresh the browser with nodemon (or other tool)? package.json { "name": "myapp", "version": "1.0.0", "description": "", "main": "index.js", "dependencies": { "bcryptjs": "^2.4.3", "body-parser": "^1.17.2", "debug": "^2.6.8", "dotenv": "^2.0.0", "express": "^4.15.3", "iconv-lite": "^0.4.17", "inversify": "^4

How to transform a npm script to a grunt task?

房东的猫 提交于 2019-12-22 14:48:45
问题 I have the following script with my nodeJS. "scripts": { "start": "grunt", "test": "node --debug --harmony node_modules/grunt-cli/bin/grunt test" } I am running node v0.11.13 so I need to set --harmony flag. On grunt the tests are configured right if I start them with npm test, but I would prefer to have it all in a gruntfile. Is there a way to configure grunt to start the server and also run the test ? 回答1: You can create an alias task that spawns grunt with those node flags, like such:

How to debug a nodemon project in VSCode

落爺英雄遲暮 提交于 2019-12-22 09:58:14
问题 I have a NodeJs project and I run it using nodemon, I wish to run it in debug mode for development tasks, but I am unable to do so. I found that I'll need to add the right configuration to the launch.json file under .vscode folder, I have a app.js file which is the main app file. And the application runs on node version 4.6.2 and on Port 8080 . In usual case I run the App using npm run dev command. Following is my launch.json file - { // Use IntelliSense to learn about possible attributes. //

How to use nodemon in NTVS(Node Tools for Visual Studio)

♀尐吖头ヾ 提交于 2019-12-21 04:35:14
问题 I was working with Node on Visual Studio Professional 13, and I soon realized that restarting my server for every change in code was becoming a hassle. So I did some research and discovered that most people used the nodemon to automatically refresh their server. Although the tutorials online used command line to install and run their server with nodemon when I used VS's interface to generate my express project and download nodemon. My problem is that when I run my server, the server doesnt

Nodemon not refreshing browser in React-Express-Node App

£可爱£侵袭症+ 提交于 2019-12-21 04:31:14
问题 I have installed nodemon locally in my workspace, but even though it restarts in the terminal after changes are made, it does not refresh the browser page. I have to manually refresh it each time. I've got Express, Node, React and Webpack running in the environment. This is how my setup looks like - My package.json starts up server.js - "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "start": "nodemon server.js" }, and server.js is - var express = require('express'); var