{"action":"opened","issue":{"url":"https://api.github.com/repos/travs/atom-package-dependencies/issues/5","labels_url":"https://api.github.com/repos/travs/atom-package-dependencies/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/travs/atom-package-dependencies/issues/5/comments","events_url":"https://api.github.com/repos/travs/atom-package-dependencies/issues/5/events","html_url":"https://github.com/travs/atom-package-dependencies/issues/5","id":54414644,"number":5,"title":"Install error","user":{"login":"basarat","id":874898,"avatar_url":"https://avatars.githubusercontent.com/u/874898?v=3","gravatar_id":"","url":"https://api.github.com/users/basarat","html_url":"https://github.com/basarat","followers_url":"https://api.github.com/users/basarat/followers","following_url":"https://api.github.com/users/basarat/following{/other_user}","gists_url":"https://api.github.com/users/basarat/gists{/gist_id}","starred_url":"https://api.github.com/users/basarat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basarat/subscriptions","organizations_url":"https://api.github.com/users/basarat/orgs","repos_url":"https://api.github.com/users/basarat/repos","events_url":"https://api.github.com/users/basarat/events{/privacy}","received_events_url":"https://api.github.com/users/basarat/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-15T05:42:39Z","updated_at":"2015-01-15T05:42:39Z","closed_at":null,"body":"Here is an atom package where I am trying to install `linter` : https://github.com/TypeStrong/atom-typescript/blob/ae8171bbcfc268c7257f0cf24b29819efec3b692/lib/main/index.js#L3-L4 \r\n```js\r\nvar apd = require('atom-package-dependencies');\r\napd.install();\r\n```\r\nmy `package.json`  https://github.com/TypeStrong/atom-typescript/blob/ae8171bbcfc268c7257f0cf24b29819efec3b692/package.json#L26-L30: \r\n```js\r\n  \"package-dependencies\": {\r\n      \"linter\": \"//this field will be ignored right now\"\r\n  }\r\n```\r\n\r\nCallstack: \r\n```js\r\nTypeError: path must be a string\r\n  at TypeError (native)\r\n  at Object.fs.openSync (fs.js:455:18)\r\n  at Object.module.(anonymous function) [as openSync] (c:\\Users\\basaratsyed\\AppData\\Local\\atom\\app-0.172.0\\resources\\atom\\common\\lib\\asar.js:422:20)\r\n  at Object.fs.readFileSync (fs.js:313:15)\r\n  at Object.fs.readFileSync (c:\\Users\\basaratsyed\\AppData\\Local\\atom\\app-0.172.0\\resources\\atom\\common\\lib\\asar.js:329:27)\r\n  at c:\\Users\\basaratsyed\\.atom\\packages\\atom-typescript\\node_modules\\atom-package-dependencies\\index.js:78:30\r\n  at c:\\Users\\basaratsyed\\.atom\\packages\\atom-typescript\\node_modules\\atom-package-dependencies\\index.js:71:5\r\n  at c:\\Users\\basaratsyed\\.atom\\packages\\atom-typescript\\node_modules\\atom-package-dependencies\\node_modules\\witwip\\witwip.js:51:23\r\n  at find (c:\\Users\\basaratsyed\\.atom\\packages\\atom-typescript\\node_modules\\atom-package-dependencies\\node_modules\\witwip\\witwip.js:95:12)\r\n  at c:\\Users\\basaratsyed\\.atom\\packages\\atom-typescript\\node_modules\\atom-package-dependencies\\node_modules\\witwip\\witwip.js:106:16\r\n  at c:\\Users\\basaratsyed\\.atom\\packages\\atom-typescript\\node_modules\\atom-package-dependencies\\node_modules\\witwip\\node_modules\\read-package-json\\read-json.js:80:40\r\n  at c:\\Users\\basaratsyed\\.atom\\packages\\atom-typescript\\node_modules\\atom-package-dependencies\\node_modules\\witwip\\node_modules\\read-package-json\\read-json.js:128:48\r\n  at c:\\Users\\basaratsyed\\.atom\\packages\\atom-typescript\\node_modules\\atom-package-dependencies\\node_modules\\witwip\\node_modules\\read-package-json\\node_modules\\graceful-fs\\graceful-fs.js:170:5\r\n  at c:\\Users\\basaratsyed\\.atom\\packages\\atom-typescript\\node_modules\\atom-package-dependencies\\node_modules\\witwip\\node_modules\\read-package-json\\node_modules\\graceful-fs\\graceful-fs.js:179:5\r\n  at fs.js:295:14\r\n  at Object.oncomplete (fs.js:93:15)\r\n```\r\n\r\n--- \r\n\r\nSeems like a bug in `witwip` as shown below after analysis of the stacktrace\r\n```\r\nfunction getPackageJSONpath(callback){\r\n  //returns path to 'package.json' in the Atom package that this is required by\r\n  var findPkg = require('witwip');\r\n  console.log('parent',module.parent); // correctly returns Module `c:\\Users\\basaratsyed\\.atom\\packages\\atom-typescript\\lib\\main\\index.js`\r\n  findPkg(module.parent, function(err, pkgPath, pkgData) {\r\n    var path = pkgPath; \r\n    console.log('path',path) // Probably the ERROR: path is undefined\r\n    callback(path);\r\n  });\r\n}\r\n```"}}