Skip to content
This repository has been archived by the owner on Jul 31, 2019. It is now read-only.

hapijs getting started tutorial: Invalid monitorOptions options reporters is required #98

Closed
hickeyadamc opened this issue Dec 10, 2014 · 2 comments
Assignees
Labels

Comments

@hickeyadamc
Copy link

Hello!

The getting started tutorial http://hapijs.com/tutorials isn't working with node 0.10.33, hapi 8.0.0, and good 5.0.0.

Here's the error:

/Users/adamhickey/HapiTutorials/myproject/node_modules/good/node_modules/hoek/lib/index.js:663
    throw new Error(msgs.join(' ') || 'Unknown error');
          ^
Error: Invalid monitorOptions options reporters is required
    at Object.exports.assert (/Users/adamhickey/HapiTutorials/myproject/node_modules/good/node_modules/hoek/lib/index.js:663:11)
    at Object.exports.assert (/Users/adamhickey/HapiTutorials/myproject/node_modules/good/lib/schema.js:11:10)
    at new module.exports.internals.Monitor (/Users/adamhickey/HapiTutorials/myproject/node_modules/good/lib/monitor.js:53:12)
    at Object.exports.register (/Users/adamhickey/HapiTutorials/myproject/node_modules/good/lib/index.js:10:19)
    at /Users/adamhickey/HapiTutorials/myproject/node_modules/hapi/lib/plugin.js:235:14
    at iterate (/Users/adamhickey/HapiTutorials/myproject/node_modules/hapi/node_modules/items/lib/index.js:35:13)
    at Object.exports.serial (/Users/adamhickey/HapiTutorials/myproject/node_modules/hapi/node_modules/items/lib/index.js:38:9)
    at internals.Plugin.register (/Users/adamhickey/HapiTutorials/myproject/node_modules/hapi/lib/plugin.js:221:11)
    at Object.<anonymous> (/Users/adamhickey/HapiTutorials/myproject/server.js:23:8)
    at Module._compile (module.js:456:26)

And here's server.js:

var Hapi = require('hapi');
var Good = require('good');

var server = new Hapi.Server();
server.connection({ port: 3000 });

server.route({
    method: 'GET',
    path: '/',
    handler: function (request, reply) {
        reply('Hello, world!');
    }
});

server.route({
    method: 'GET',
    path: '/{name}',
    handler: function (request, reply) {
        reply('Hello, ' + encodeURIComponent(request.params.name) + '!');
    }
});

server.register(Good, function (err) {
    if (err) {
        throw err; // something bad happened loading the plugin
    }

    server.start(function () {
        server.log('info', 'Server running at: ' + server.info.uri);
    });
});
@nlf nlf added the bug label Dec 10, 2014
@nlf nlf self-assigned this Dec 10, 2014
@nlf
Copy link
Contributor

nlf commented Dec 10, 2014

You're absolutely right, fortunately this got fixed in #99

@nlf nlf closed this as completed Dec 10, 2014
@hickeyadamc
Copy link
Author

That was fast! Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants