标签: grunt-nodemon

nodemon app崩溃 - 在开始之前等待文件更改

编辑 经过进一步的测试,我发现在这个应用程序和默认安装的mean.js上都会发生这种情况.我在Mac上本地运行它.当我使用"node server.js"运行任一app时,它们不会崩溃.

我正在使用带有grunt-nodemon的MEAN堆栈,并且当访问快速URL时节点崩溃.但它并不总是一致的.有时它可以工作,有时当URL被命中时节点崩溃而没有数据,有时我得到响应并且节点在之后立即崩溃.

浏览器控制台响应

http://localhost:8000/api/users net::ERR_CONNECTION_REFUSED
Run Code Online (Sandbox Code Playgroud)

终端输出:

Mongoose: users.insert({ firstname: 'mike', lastname: 'jones', email:'mike@gmail.com', role: 'admin', password: 'mike', _id: ObjectId("57485c16fc11894b96c28057"), created: new Date("Fri, 27 May 2016 14:39:18 GMT"), __v: 0 })   
user.save success
node crash
[nodemon] app crashed - waiting for file changes before starting...
Run Code Online (Sandbox Code Playgroud)

在这种情况下,POST请求通过,添加了用户,然后节点崩溃,但有时它会在POST成功之前崩溃.节点偶尔也会在GET请求中崩溃.

gruntfile.js:

module.exports = function(grunt) {
    // Load grunt tasks automatically
    require('load-grunt-tasks')(grunt);

    var pkg = grunt.file.readJSON('package.json');

    var options = {
        paths: {
            app: 'app',
            assets: 'app/assets',
            dist: 'app/dist',
            distAssets: 'app/dist/assets',
            html: 'app/html',
            htmlTmp: '.tmp/htmlsnapshot', …
Run Code Online (Sandbox Code Playgroud)

node.js angularjs mean-stack grunt-nodemon

7
推荐指数
6
解决办法
2万
查看次数

标签 统计

angularjs ×1

grunt-nodemon ×1

mean-stack ×1

node.js ×1