{"action":"created","issue":{"url":"https://api.github.com/repos/srod/node-minify/issues/91","repository_url":"https://api.github.com/repos/srod/node-minify","labels_url":"https://api.github.com/repos/srod/node-minify/issues/91/labels{/name}","comments_url":"https://api.github.com/repos/srod/node-minify/issues/91/comments","events_url":"https://api.github.com/repos/srod/node-minify/issues/91/events","html_url":"https://github.com/srod/node-minify/issues/91","id":132928271,"number":91,"title":"Issue with NPM 3 and uglifyjs","user":{"login":"Belleal","id":10058988,"avatar_url":"https://avatars.githubusercontent.com/u/10058988?v=3","gravatar_id":"","url":"https://api.github.com/users/Belleal","html_url":"https://github.com/Belleal","followers_url":"https://api.github.com/users/Belleal/followers","following_url":"https://api.github.com/users/Belleal/following{/other_user}","gists_url":"https://api.github.com/users/Belleal/gists{/gist_id}","starred_url":"https://api.github.com/users/Belleal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Belleal/subscriptions","organizations_url":"https://api.github.com/users/Belleal/orgs","repos_url":"https://api.github.com/users/Belleal/repos","events_url":"https://api.github.com/users/Belleal/events{/privacy}","received_events_url":"https://api.github.com/users/Belleal/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-02-11T09:44:53Z","updated_at":"2016-02-11T21:23:54Z","closed_at":"2016-02-11T20:24:50Z","body":"When using node-minify with NPM 3 we have issue that it's not able to find the uglifyjs module even though it's in the node_modules folder. After some investigation I found that the problem starts on line **97** in the **node-minify.js** file where it was checking the npm version. I did the following workaround to solve this for us temporary:\r\n\r\n```\r\nvar nodeModulesV3 = path.normalize(__dirname + '/../../');\r\nvar isNPMv2 = dirExistsSync(nodeModulesV2);\r\nvar isNPMv3 = ( process.version.indexOf( \"v5\" ) > -1 );\r\nvar dirToScan = isNPMv3 ? nodeModulesV3 : ( isNPMv2 ? nodeModulesV2 : '' );\r\n```\r\n\r\nThere certainly is a better solution for this, so I don't want to submit this as a fix. Instead please use this issue as notification that the bug exists and needs attention."},"comment":{"url":"https://api.github.com/repos/srod/node-minify/issues/comments/183064669","html_url":"https://github.com/srod/node-minify/issues/91#issuecomment-183064669","issue_url":"https://api.github.com/repos/srod/node-minify/issues/91","id":183064669,"user":{"login":"Belleal","id":10058988,"avatar_url":"https://avatars.githubusercontent.com/u/10058988?v=3","gravatar_id":"","url":"https://api.github.com/users/Belleal","html_url":"https://github.com/Belleal","followers_url":"https://api.github.com/users/Belleal/followers","following_url":"https://api.github.com/users/Belleal/following{/other_user}","gists_url":"https://api.github.com/users/Belleal/gists{/gist_id}","starred_url":"https://api.github.com/users/Belleal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Belleal/subscriptions","organizations_url":"https://api.github.com/users/Belleal/orgs","repos_url":"https://api.github.com/users/Belleal/repos","events_url":"https://api.github.com/users/Belleal/events{/privacy}","received_events_url":"https://api.github.com/users/Belleal/received_events","type":"User","site_admin":false},"created_at":"2016-02-11T21:23:54Z","updated_at":"2016-02-11T21:23:54Z","body":"Great, thank you."}}