{"action":"created","issue":{"url":"https://api.github.com/repos/sindresorhus/gulp-mocha/issues/86","labels_url":"https://api.github.com/repos/sindresorhus/gulp-mocha/issues/86/labels{/name}","comments_url":"https://api.github.com/repos/sindresorhus/gulp-mocha/issues/86/comments","events_url":"https://api.github.com/repos/sindresorhus/gulp-mocha/issues/86/events","html_url":"https://github.com/sindresorhus/gulp-mocha/issues/86","id":60807213,"number":86,"title":"Module did not self-register.","user":{"login":"freder","id":724844,"avatar_url":"https://avatars.githubusercontent.com/u/724844?v=3","gravatar_id":"","url":"https://api.github.com/users/freder","html_url":"https://github.com/freder","followers_url":"https://api.github.com/users/freder/followers","following_url":"https://api.github.com/users/freder/following{/other_user}","gists_url":"https://api.github.com/users/freder/gists{/gist_id}","starred_url":"https://api.github.com/users/freder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/freder/subscriptions","organizations_url":"https://api.github.com/users/freder/orgs","repos_url":"https://api.github.com/users/freder/repos","events_url":"https://api.github.com/users/freder/events{/privacy}","received_events_url":"https://api.github.com/users/freder/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-03-12T11:50:32Z","updated_at":"2015-04-03T04:01:34Z","closed_at":"2015-03-22T17:45:14Z","body":"hi,\r\n\r\nI'm not sure if it's a gulp-mocha problem per se, but it happens when I'm running test with gulp-mocha, so I'm posting it here.\r\n\r\n`gulpfile.js`\r\n\r\n```js\r\nvar source_file_pattern = path.join(src_dir, '**/*.js');\r\nvar test_file_pattern = path.join(test_dir, '*.js');\r\n\r\ngulp.task('mocha', function() {\r\n\treturn gulp.src(test_file_pattern, { read: false })\r\n\t\t.pipe(mocha())\r\n\t\t.on('error', function(err) {\r\n\t\t\tnotifier.notify({\r\n\t\t\t\ttitle: err.plugin,\r\n\t\t\t\tmessage: err.message\r\n\t\t\t});\r\n\t\t});\r\n});\r\n\r\ngulp.task('watch', function() {\r\n\tgulp.watch([source_file_pattern, test_file_pattern], ['mocha']);\r\n});\r\n\r\ngulp.task('default', ['watch']);\r\n```\r\n\r\n`./test/test.js`\r\n\r\n```js\r\nvar libxml = require('libxmljs');\r\n\r\ndescribe('validation', function() {\r\n\tit('should be a valid document', function() {\r\n\t\t//\r\n\t});\r\n});\r\n```\r\n\r\nso when I run gulp, it watches for file changes and runs the test once something changes. the first time the tests run fine, the second time this happens:\r\n\r\n```\r\n[12:35:03] Using gulpfile /Volumes/Macintosh HD 2/Projects/project/code/project.js/gulpfile.js\r\n[12:35:03] Starting 'watch'...\r\n[12:35:03] Finished 'watch' after 14 ms\r\n[12:35:03] Starting 'default'...\r\n[12:35:03] Finished 'default' after 13 μs\r\n[12:35:22] Starting 'mocha'...\r\n\r\n\r\n  validation\r\n    ✓ should be a valid document\r\n\r\n\r\n  1 passing (22ms)\r\n\r\n[12:35:22] Finished 'mocha' after 129 ms\r\n[12:35:24] Starting 'mocha'...\r\n[12:35:24] 'mocha' errored after 35 ms\r\n[12:35:24] Error in plugin 'gulp-mocha'\r\nMessage:\r\n    Module did not self-register.\r\nStack:\r\nError: Module did not self-register.\r\n    at Error (native)\r\n    at Module.load (module.js:355:32)\r\n    at Function.Module._load (module.js:310:12)\r\n    at Module.require (module.js:365:17)\r\n    at require (module.js:384:17)\r\n    at bindings (/Volumes/Macintosh HD 2/Projects/project/code/project.js/node_modules/libxmljs/node_modules/bindings/bindings.js:76:44)\r\n    at Object.<anonymous> (/Volumes/Macintosh HD 2/Projects/project/code/project.js/node_modules/libxmljs/lib/bindings.js:1:99)\r\n    at Module._compile (module.js:460:26)\r\n    at Object.Module._extensions..js (module.js:478:10)\r\n    at Module.load (module.js:355:32)\r\n```\r\n\r\nso this seems to have something to do with [libxmljs](https://github.com/polotek/libxmljs) (or its dependencies). however, when I do `mocha --watch`, I don't get the error.\r\n\r\nversions:\r\n\r\n```shell\r\n% npm ls | ag '(gulp[^-]|mocha|libxmljs|bindings)'\r\n├─┬ gulp@3.8.11\r\n├─┬ gulp-mocha@2.0.0\r\n├─┬ libxmljs@0.13.0\r\n│ ├── bindings@1.2.1\r\n├─┬ mocha@2.1.0\r\n\r\n% node -v\r\nv0.12.0\r\n```\r\n\r\nany ideas?\r\n"},"comment":{"url":"https://api.github.com/repos/sindresorhus/gulp-mocha/issues/comments/89154850","html_url":"https://github.com/sindresorhus/gulp-mocha/issues/86#issuecomment-89154850","issue_url":"https://api.github.com/repos/sindresorhus/gulp-mocha/issues/86","id":89154850,"user":{"login":"rockymadden","id":538508,"avatar_url":"https://avatars.githubusercontent.com/u/538508?v=3","gravatar_id":"","url":"https://api.github.com/users/rockymadden","html_url":"https://github.com/rockymadden","followers_url":"https://api.github.com/users/rockymadden/followers","following_url":"https://api.github.com/users/rockymadden/following{/other_user}","gists_url":"https://api.github.com/users/rockymadden/gists{/gist_id}","starred_url":"https://api.github.com/users/rockymadden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rockymadden/subscriptions","organizations_url":"https://api.github.com/users/rockymadden/orgs","repos_url":"https://api.github.com/users/rockymadden/repos","events_url":"https://api.github.com/users/rockymadden/events{/privacy}","received_events_url":"https://api.github.com/users/rockymadden/received_events","type":"User","site_admin":false},"created_at":"2015-04-03T04:01:34Z","updated_at":"2015-04-03T04:01:34Z","body":"I have observed this same issue, thanks @AlexeyGrishin."}}