Tag: nodemon

如何使用nodemon进行linting?

我可以使用nodemon来皮我的JavaScript? 我没有使用任何构build工具,如吞咽或咕噜,并希望最大限度地使用节点和NPM。 nodemon的输出可以被传送 。 我想用这个来修改使用eslint的文件。 这是我的package.json { "name": "app", "version": "0.0.1", "private": true, "scripts": { "start": "nodemon server.js", "lint": "eslint" }, "dependencies": { "MD5": "*", "clean-css": "*", "express": "~4.9.0", "express-handlebars": "~2.0.1", "express-redis-cache": "*", "foundation-sites": "~5.5.3", "fs-extra": "~0.8.1", "node-rest-client": "~1.5.1", "node-sass": "*", "path": "*" }, "devDependencies": { "babel-eslint": "^4.1.6", "eslint": "^1.10.3", "eslint-config-airbnb": "^2.1.1", "eslint-config-airbnb-es5": "^1.0.8", "eslint-plugin-react": […]

如何将parameter passing给nodemon(或node-supervisor)中的可执行文件?

节点可以像这样使用debugging参数运行 $ node –debug src/file.js 我也可以像这样通过咖啡脚本二进制传递参数 $ coffee –nodejs –debug src/file.coffee 哪个工作。 但是当涉及主pipe时事情会变得更加困难。 运行咖啡脚本是没有问题的: $ supervisor -w src src/file.coffee 但是我想debugging我和主pipe一起运行的咖啡脚本。 如何通过主pipe发送–debug等参数? 我试着将可执行文件设置为像这样的参数的string: $ supervisor -w src -x "coffee –nodejs –debug" src/server.coffee 其中产生了一个无限重复的错误信息说 DEBUG:用'coffee –nodejs –debug src / server.coffee'开始subprocess DEBUG:execvp():没有这样的文件或目录 这很奇怪,因为在terminal中运行coffee –nodejs –debug src/server.coffee工作。 那么我怎么能通过主pipe发表意见 ? 编辑:我想扩大我的问题,提到我现在也尝试使用nodemon 。 看起来nodemon被认为比node-supervisor更可取,所以我会接受任何解释如何通过nodemon启动咖啡脚本来传递–debug到节点进程 编辑:这是来自nodemon的输出。 很明显,这些论点不是以相同的顺序传递的:-( $ nodemon -w src -x咖啡–nodejs […]

自动重新加载Koa服务器

我已经开始玩Koa了 ,但到目前为止一直没有find一个体面的解决scheme,自动重新加载应用程序的代码更改。 我的理解是nodemon是Node宇宙中的首选解决scheme,但由于–harmony标志(Koa要求),我得到错误: $ node_modules/.bin/nodemon /path/to/node-unstable/bin/node app.js /path/to/node-unstable/bin/node –harmony $@ ^^^^^^^ SyntaxError: Unexpected identifier [nodemon] app crashed – waiting for file changes before starting…

如何在JSX中使用nodemon?

我可以用一个命令编译和运行我的JSX应用程序: jsx app.jsx | node 但我也希望我的服务器每次修改app.jsx时自动重启。 我可以用nodemon来完成 ,但是我不能完全弄清楚如何让nodemon事先通过JSX编译器来运行我的脚本。 我有一个nodemon.json文件像这样设置: { "execMap": { "js": "node", "jsx": "jsx {{filename}} | node" }, "ext": "js jsx", "ignore": [ ".hg", "node_modules", ".idea" ], "verbose": true } 但是当我运行nodemon它告诉我: 8 Feb 21:58:48 – [nodemon] starting `jsx app.jsx | node` 8 Feb 21:58:48 – [nodemon] child pid: 10976 '\"jsx app.jsx | node\"' […]

nodemon不起作用:-bash:nodemon:找不到命令

我在运行El Capitan的Mac上。 我有节点v5.6.0和npm v3.6.0。 当我尝试运行nodemon时,我得到: -bash: nodemon: command not found 我认为这可能意味着我没有安装nodemon,所以当我尝试使用…安装它时 sudo npm intall -g nodemon …我得到这个: npm ERR! Darwin 15.2.0 npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "nodemon" npm ERR! node v5.6.0 npm ERR! npm v3.6.0 npm ERR! path /usr/local/bin/nodemon npm ERR! code EEXIST npm ERR! Refusing to delete /usr/local/bin/nodemon: ../lib/node_modules/nodemon/nodemon.js symlink target is […]

节点js服务器的terminal中不能识别nodemon命令

我正在做https://scotch.io/tutorials/authenticate-a-node-js-api-with-json-web-tokens的 node.js服务器设置。 我在node.js中是新的 我正在安装npm install nodemon –save 。 但是当我用这个nodemon server.js运行服务器。 在terminal显示: nodemon不被识别为内部或外部命令,可操作的程序或batch file node server.js命令正在运行并启动服务器,但是nodemon命令不起作用。 我从https://scotch.io/tutorials/authenticate-a-node-js-api-with-json-web-tokensvideo设置了节点js服务器。 我不知道为什么它不工作我已经尝试了一些安装nodemon的命令。 npm install -g nodemon npm install -g nodemon –save npm install –save-dev nodemon npm install -g nodemon@debug npm install -g –force nodemon 我已经看到一个链接, 我不能安装nodemon全局,“nodemon”不能识别 ,但我不知道如何设置path,因为我的项目位置在D盘。 我想运行nodemon server.js 。 如果任何机构有一个想法,请分享。 提前致谢。

Node.js – 自动刷新在Dev

我正在尝试改进我的节点中的DEV经验。 要做到这一点,我想: a)当服务器端代码改变时重启我的服务器 b)当客户端代码改变时刷新浏览器。 为了做到这一点,我开始将nodemon和browserSync集成到我的gulp脚本中。 在我的gulp脚本中,我有以下任务: gulp.task('startDevEnv', function(done) { // Begin watching for server-side file changes nodemon( { script: input.server, ignore:[input.views] }) .on('start', function () { browserSync.init({ proxy: "http://localhost:3002" }); }) ; // Begin watching client-side file changes gulp.watch([ input.css, input.js, input.html ], function() { browserSync.reload(); }); done(); }); 当上述任务运行时,我的浏览器打开到http:// localhost:3000 / 。 我的应用程序是可见的预期。 但是,在控制台窗口中,我注意到: […]

如何使用Nodemon监控符号链接模块?

我正在开发Node.js模块,我已经npm链接到另一个项目node_modules文件夹。 我想重新启动这个其他项目服务器在我的模块中的文件更改。 Nodemon默认会忽略node_modules,但是我认为我可以用nodemon –watch node_modules / my_module覆盖它,但是无法使其工作。 如果我暂时从nodemons lib / config / defaults.js中删除node_modules,它可能会起作用,这可能确认问题与重写默认行为有关。

nodemon无法正常工作

我通过npm start运行我的nodejs应用npm start 我只是通过sudo npm install -g nodemon这样我可以在我将更改保存到文件时重新启动服务器。 但是,当我尝试启动服务器,这样的事情 nodemon ./app.js localhost 3000 or nodemon start localhost 3000 我得到这个输出 LM-SJC-00871929:webapp gdeep$ nodemon ./app.js localhost 3000 28 May 23:34:30 – [nodemon] v1.1.1 28 May 23:34:30 – [nodemon] to restart at any time, enter `rs` 28 May 23:34:30 – [nodemon] watching: *.* 28 May 23:34:30 – [nodemon] […]

可以将Visual Studio Codeconfiguration为使用nodemon启动

我已经在我的系统中安装了nodemon作为全局包。 它在我在cmd中执行nodemon时nodemon 。 但是当我用这个launch.json文件使用vscode时,vscode抛出这个exception: 请求启动:运行时可执行文件XXX \ XXX \ XXX \ XXX \ nodemon不存在 launch.json是: { "version": "0.2.0", "configurations": [ { "name": "Launch", "type": "node", "request": "launch", "program": "app.js", "stopOnEntry": false, "args": [], "cwd": ".", "runtimeExecutable": nodemon, "runtimeArgs": [ "–nolazy" ], "env": { "NODE_ENV": "development" }, "externalConsole": false, "preLaunchTask": "", "sourceMaps": false, "outDir": null }, { […]