{"action":"created","issue":{"url":"https://api.github.com/repos/lodash/lodash-cli/issues/78","labels_url":"https://api.github.com/repos/lodash/lodash-cli/issues/78/labels{/name}","comments_url":"https://api.github.com/repos/lodash/lodash-cli/issues/78/comments","events_url":"https://api.github.com/repos/lodash/lodash-cli/issues/78/events","html_url":"https://github.com/lodash/lodash-cli/issues/78","id":127099659,"number":78,"title":"Custom builds fail with 'ReferenceError: module is not defined'","user":{"login":"sverweij","id":4822597,"avatar_url":"https://avatars.githubusercontent.com/u/4822597?v=3","gravatar_id":"","url":"https://api.github.com/users/sverweij","html_url":"https://github.com/sverweij","followers_url":"https://api.github.com/users/sverweij/followers","following_url":"https://api.github.com/users/sverweij/following{/other_user}","gists_url":"https://api.github.com/users/sverweij/gists{/gist_id}","starred_url":"https://api.github.com/users/sverweij/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sverweij/subscriptions","organizations_url":"https://api.github.com/users/sverweij/orgs","repos_url":"https://api.github.com/users/sverweij/repos","events_url":"https://api.github.com/users/sverweij/events{/privacy}","received_events_url":"https://api.github.com/users/sverweij/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/lodash/lodash-cli/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-17T14:55:32Z","updated_at":"2016-01-22T14:20:06Z","closed_at":"2016-01-17T15:37:33Z","body":"### steps taken\r\n```\r\n> npm install --global lodash-cli\r\n(...)\r\n> lodash --version\r\n4.0.0\r\n> lodash -o ./lodash.js\r\n```\r\n\r\n### expected\r\nlodash-cli generates a lodash.custom.js\r\n\r\n### found\r\nAn error message (see below)\r\n\r\n### notes\r\n- I originally tried with `lodash include=memoize,cloneDeep,flatten,defaults --development --output ./lodash.custom.js` - which gave the same results.\r\n- env:\r\n  - node 5.4.1 (/ npm 3.3.12) on OS X\r\n  - node 4.2.4 (/ npm 2.14.12) on OS X\r\n- `lodash --version` and `lodash --help` work as expected\r\n- lodash-cli 3.10.1 works fine in the same envs\r\n\r\n### error message\r\n```\r\nevalmachine.<anonymous>:1\r\nmodule.exports = require('./lodash.js');\r\n^\r\n\r\nReferenceError: module is not defined\r\n    at evalmachine.<anonymous>:1:1\r\n    at Object.exports.runInContext (vm.js:44:17)\r\n    at /Users/sverweij/.nvm/versions/node/v5.4.1/lib/node_modules/lodash-cli/bin/lodash:3056:10\r\n    at build (/Users/sverweij/.nvm/versions/node/v5.4.1/lib/node_modules/lodash-cli/bin/lodash:3058:6)\r\n    at Object.<anonymous> (/Users/sverweij/.nvm/versions/node/v5.4.1/lib/node_modules/lodash-cli/bin/lodash:3410:3)\r\n    at Module._compile (module.js:397:26)\r\n    at Object.Module._extensions..js (module.js:404:10)\r\n    at Module.load (module.js:343:32)\r\n    at Function.Module._load (module.js:300:12)\r\n    at Function.Module.runMain (module.js:429:10)\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/lodash/lodash-cli/issues/comments/173932529","html_url":"https://github.com/lodash/lodash-cli/issues/78#issuecomment-173932529","issue_url":"https://api.github.com/repos/lodash/lodash-cli/issues/78","id":173932529,"user":{"login":"arendjr","id":533294,"avatar_url":"https://avatars.githubusercontent.com/u/533294?v=3","gravatar_id":"","url":"https://api.github.com/users/arendjr","html_url":"https://github.com/arendjr","followers_url":"https://api.github.com/users/arendjr/followers","following_url":"https://api.github.com/users/arendjr/following{/other_user}","gists_url":"https://api.github.com/users/arendjr/gists{/gist_id}","starred_url":"https://api.github.com/users/arendjr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arendjr/subscriptions","organizations_url":"https://api.github.com/users/arendjr/orgs","repos_url":"https://api.github.com/users/arendjr/repos","events_url":"https://api.github.com/users/arendjr/events{/privacy}","received_events_url":"https://api.github.com/users/arendjr/received_events","type":"User","site_admin":false},"created_at":"2016-01-22T14:20:06Z","updated_at":"2016-01-22T14:20:06Z","body":"Are you sure about this? I just cloned this repo because I was running into the same issue and wanted to try the fix, but even running the master branch I still had this issue.\r\n\r\nMaybe I did something wrong though, because I had to adjust the package.json to still use lodash 4.0.0 or otherwise NPM would complain it could not find 4.0.1-pre. But I'm assuming the fix is in the lodash-cli repo and it should still work even with an unpatched lodash library. Otherwise, what's the best way to install the 4.0.1-pre version to try it out? Thanks!"}}