nodemon

Nodemon watch option broken

纵然是瞬间 提交于 2019-12-06 03:50:04
问题 I am using gulp-nodemon config directory includes only one file, server.js. $.nodemon({ script: 'config/server.js', watch: ['config/**/*.js'] }) .on('restart', function () { setTimeout(function () { $.livereload.changed(); }, 1000); }); Output: [gulp] [nodemon] v1.2.1 [gulp] [nodemon] to restart at any time, enter `rs` [gulp] [nodemon] watching: config/**/*.js [gulp] [nodemon] starting `node config/server.js` [gulp] [nodemon] watching 34,325 files - this might cause high cpu usage. To reduce

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

試著忘記壹切 提交于 2019-12-06 01:16:43
问题 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 error: 2014-03-24T19:24:59.669412+00:00 app[web.1]: > my-app@0.0.1 start /app 2014-03-24T19:24:59.669412+00:00 app[web.1]: > nodemon app.js 2014-03-24T19:24:59.669412+00:00 app[web.1]: 2014-03-24T19:24:59.669412+00:00 app[web.1]: 2014-03-24T19:24:59.710228+00:00 app[web.1]:

package.json 详解

岁酱吖の 提交于 2019-12-06 00:24:48
Node 项目在项目根目录中名为 package.json 的文件中跟踪依赖关系和元数据。这是你项目的核心。它包含名称、描述和版本之类的信息,以及运行、开发以及有选择地将项目发布到 NPM 所需的信息。 在本教程中,我们将: 了解 package.json 与项目之间的关系 确定重要字段和元数据 了解如何管理 package.json 目标 了解什么是 package.json 文件,它与你项目的关系以及需要了解的常见属性。 了解 package.json 如果你以前用过 Node.js,则可能会遇到 package.json 文件。它是一个 JSON 文件,位于项目的根目录中。你的 package.json 包含关于项目的重要信息。它包含关于项目的使人类可读元数据(如项目名称和说明)以及功能元数据(如程序包版本号和程序所需的依赖项列表)。 package.json 示例如下所示: { "name": "my-project", "version": "1.5.0", "description": "Express server project using compression", "main": "src/index.js", "scripts": { "start": "node index.js", "dev": "nodemon", "lint": "eslint **/

How to debug a nodemon project in VSCode

故事扮演 提交于 2019-12-05 20:02:25
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. // Hover to view descriptions of existing attributes. // For more information, visit: https://go

How to rebuild node.js addon when source changes

六月ゝ 毕业季﹏ 提交于 2019-12-05 10:08:19
I have a node.js app and I have created a native addon. (In case you need background info, native addons for node.js can be created like this ). In my development environment I want it to watch source files (these are C++ source files, in this case) and automatically rebuild my addon when the C++ source files change, and also automatically restart the node application after the build completes. I'm certain there's more than one way to accomplish this, but I went down the road of trying nodemon. But I couldn't figure out how to get nodemon to wait for the build to finish before restarting the

Express and BrowserSync without gulp?

て烟熏妆下的殇ゞ 提交于 2019-12-04 23:53:11
问题 I'm working on an express app. I used browserSync only to watch static files but now, I want to do the same with an express app. I saw a lot of examples using Gulp. But i wonder if there is any solution to manage only with npm scripts? (and nodemon?) My current scripts: "scripts": { "start": "npm run start-server & npm run watch-js", "build-js": "browserify -t babelify -t aliasify -t partialify src/ | uglifyjs > public/app.js", "start-server": "browser-sync start --server 'public/' --files

Nodemon watch option broken

末鹿安然 提交于 2019-12-04 08:21:51
I am using gulp-nodemon config directory includes only one file, server.js. $.nodemon({ script: 'config/server.js', watch: ['config/**/*.js'] }) .on('restart', function () { setTimeout(function () { $.livereload.changed(); }, 1000); }); Output: [gulp] [nodemon] v1.2.1 [gulp] [nodemon] to restart at any time, enter `rs` [gulp] [nodemon] watching: config/**/*.js [gulp] [nodemon] starting `node config/server.js` [gulp] [nodemon] watching 34,325 files - this might cause high cpu usage. To reduce use "--watch". If i include an ignore option it fixes. ignore: [ 'node_modules/**', 'bower_components/*

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

末鹿安然 提交于 2019-12-04 06:09:36
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 error: 2014-03-24T19:24:59.669412+00:00 app[web.1]: > my-app@0.0.1 start /app 2014-03-24T19:24:59.669412+00:00 app[web.1]: > nodemon app.js 2014-03-24T19:24:59.669412+00:00 app[web.1]: 2014-03-24T19:24:59.669412+00:00 app[web.1]: 2014-03-24T19:24:59.710228+00:00 app[web.1]: 2014-03-24T19:24:59.701246+00:00 app[web.1]: sh: nodemon: not found I even tried npm installing nodemon as

TypeScript 3 + Koajs + Node.js

亡梦爱人 提交于 2019-12-03 23:56:48
转发 TypeScript 3 + Koajs + Node.js 自NodeJS早期以来,Express一直是NodeJS开发人员事实上的标准Web框架。 但是,JavaScript在过去几年中已经走过了漫长的道路,像promises和async函数这样的功能使得构建更小,更强大的Web框架成为可能。 Koa就是这样一个框架。 它由Express背后的团队构建,以利用最新的JavaScript和NodeJS功能,特别是异步功能。 与Express和其他node框架(如Hapi)不同,Koa不需要使用回调。 这消除了难以跟踪的错误的巨大潜在来源,并使框架非常容易为新开发人员选择。 在本文中,我将向您介绍如何使用Koa和TypeScript来开发新的Web应用程序项目 第一步、安装和配置 Koa需要一个具有异步功能支持的Node版本,因此在开始之前确保安装了Node 8.x(或更高版本)。 Node 8将于2017年10月成为新的长期支持版本,因此它是启动新项目的绝佳选择。 我们现在将创建一个安装了以下内容的新node项目: 1. Koa 2. Koa Router 3. TypeScript 4. TS-Node 和 Nodemon(用于在开发期间自动构建和重启) 为项目创建一个新文件夹,然后执行以下命令: npm init # and follow the resulting

Restart Heroku local on file change?

点点圈 提交于 2019-12-03 15:20:11
问题 It seems the local server started with "heroku local web" does not watch for file changes and restart itself. How can I make it do this? 回答1: The easiest way to do this is to run nodemon with heroku local as the executable - i.e. nodemon --exec "heroku local" . However, heroku local exits with a non-zero exit code for the default nodemon shutdown signal (SIGUSR2), so you need to add an additional flag to nodemon to set the interrupt signal to SIGTERM. nodemon --exec "heroku local" --signal