{"action":"created","issue":{"url":"https://api.github.com/repos/tkellen/js-matchdep/issues/11","labels_url":"https://api.github.com/repos/tkellen/js-matchdep/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/tkellen/js-matchdep/issues/11/comments","events_url":"https://api.github.com/repos/tkellen/js-matchdep/issues/11/events","html_url":"https://github.com/tkellen/js-matchdep/issues/11","id":25978546,"number":11,"title":"matchdep will break when there is no package.json in the project","user":{"login":"hvgeertruy","id":2580632,"avatar_url":"https://avatars.githubusercontent.com/u/2580632?v=3","gravatar_id":"","url":"https://api.github.com/users/hvgeertruy","html_url":"https://github.com/hvgeertruy","followers_url":"https://api.github.com/users/hvgeertruy/followers","following_url":"https://api.github.com/users/hvgeertruy/following{/other_user}","gists_url":"https://api.github.com/users/hvgeertruy/gists{/gist_id}","starred_url":"https://api.github.com/users/hvgeertruy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hvgeertruy/subscriptions","organizations_url":"https://api.github.com/users/hvgeertruy/orgs","repos_url":"https://api.github.com/users/hvgeertruy/repos","events_url":"https://api.github.com/users/hvgeertruy/events{/privacy}","received_events_url":"https://api.github.com/users/hvgeertruy/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-01-21T10:45:41Z","updated_at":"2015-09-27T21:10:19Z","closed_at":"2015-09-27T21:10:19Z","body":"I stumbled on this one. You might want to create an error message for this as the current response is confusing.\r\n\r\n```\r\n$ grunt\r\nRegistering Gruntfile tasks.\r\nLoading \"Gruntfile.js\" tasks...ERROR\r\n>> TypeError: Cannot read property 'devDependencies' of null\r\n>>     at /opt/apps/checkouts/experiments/node/webapp-new/client/node_modules/matchdep/lib/matchdep.js:50:26\r\n>>     at Array.forEach (native)\r\n>>     at loadConfig (/opt/apps/checkouts/experiments/node/webapp-new/client/node_modules/matchdep/lib/matchdep.js:49:9)\r\n>>     at Object.matchdep.(anonymous function) [as filterDev] (/opt/apps/checkouts/experiments/node/webapp-new/client/node_modules/matchdep/lib/matchdep.js:67:14)\r\n>>     at Object.module.exports (/opt/apps/checkouts/experiments/node/webapp-new/client/Gruntfile.js:2:25)\r\n>>     at loadTask (/opt/apps/checkouts/experiments/node/webapp-new/client/node_modules/grunt/lib/grunt/task.js:318:10)\r\n>>     at Task.task.init (/opt/apps/checkouts/experiments/node/webapp-new/client/node_modules/grunt/lib/grunt/task.js:430:5)\r\n>>     at Object.grunt.tasks (/opt/apps/checkouts/experiments/node/webapp-new/client/node_modules/grunt/lib/grunt.js:113:8)\r\n>>     at Object.module.exports [as cli] (/opt/apps/checkouts/experiments/node/webapp-new/client/node_modules/grunt/lib/grunt/cli.js:38:9)\r\n>>     at Object.<anonymous> (/usr/local/lib/node_modules/grunt-cli/bin/grunt:43:20)\r\n\r\nNo tasks specified, running default tasks.\r\nRunning tasks: default\r\nWarning: Task \"default\" not found. Use --force to continue.\r\n\r\nAborted due to warnings.\r\n```\r\n\r\nIt makes sense when you know it, but it took me a while to figure out what was wrong.\r\n\r\nThe error specifies that it can not find grunt task \"default\" (but it was there!). If you dig deeper, you will notice this error:\r\n```TypeError: Cannot read property 'devDependencies' of null```\r\n\r\nturns out the script was missing this prop from package.json, but it failed to tell me it was missing package.json entirely.\r\n\r\nI used *npm init* to fix this. Had to copy dependencies to devDependencies as well, otherwise grunt did not recognise my tasks."},"comment":{"url":"https://api.github.com/repos/tkellen/js-matchdep/issues/comments/143595275","html_url":"https://github.com/tkellen/js-matchdep/issues/11#issuecomment-143595275","issue_url":"https://api.github.com/repos/tkellen/js-matchdep/issues/11","id":143595275,"user":{"login":"phated","id":992373,"avatar_url":"https://avatars.githubusercontent.com/u/992373?v=3","gravatar_id":"","url":"https://api.github.com/users/phated","html_url":"https://github.com/phated","followers_url":"https://api.github.com/users/phated/followers","following_url":"https://api.github.com/users/phated/following{/other_user}","gists_url":"https://api.github.com/users/phated/gists{/gist_id}","starred_url":"https://api.github.com/users/phated/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phated/subscriptions","organizations_url":"https://api.github.com/users/phated/orgs","repos_url":"https://api.github.com/users/phated/repos","events_url":"https://api.github.com/users/phated/events{/privacy}","received_events_url":"https://api.github.com/users/phated/received_events","type":"User","site_admin":false},"created_at":"2015-09-27T21:10:19Z","updated_at":"2015-09-27T21:10:19Z","body":"Published as 1.0.0"}}