{"action":"created","issue":{"url":"https://api.github.com/repos/webpack/webpack/issues/1260","repository_url":"https://api.github.com/repos/webpack/webpack","labels_url":"https://api.github.com/repos/webpack/webpack/issues/1260/labels{/name}","comments_url":"https://api.github.com/repos/webpack/webpack/issues/1260/comments","events_url":"https://api.github.com/repos/webpack/webpack/issues/1260/events","html_url":"https://github.com/webpack/webpack/issues/1260","id":95655358,"number":1260,"title":"Cannot find module './node_modules/babel-loader/index.js'","user":{"login":"renestalder","id":105358,"avatar_url":"https://avatars.githubusercontent.com/u/105358?v=3","gravatar_id":"","url":"https://api.github.com/users/renestalder","html_url":"https://github.com/renestalder","followers_url":"https://api.github.com/users/renestalder/followers","following_url":"https://api.github.com/users/renestalder/following{/other_user}","gists_url":"https://api.github.com/users/renestalder/gists{/gist_id}","starred_url":"https://api.github.com/users/renestalder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renestalder/subscriptions","organizations_url":"https://api.github.com/users/renestalder/orgs","repos_url":"https://api.github.com/users/renestalder/repos","events_url":"https://api.github.com/users/renestalder/events{/privacy}","received_events_url":"https://api.github.com/users/renestalder/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-07-17T13:20:46Z","updated_at":"2016-03-29T12:13:43Z","closed_at":"2015-09-25T11:45:04Z","body":"This isn't entirely a new problem. I found several topics here and most solutions point to the resolve configuration, e.g. #1083 . Anyway, I've tried all the things and can't get my script running.\r\n\r\nMy folder structure looks like this:\r\n\r\n```\r\n- package.json\r\n- node_modules\r\n- dist\r\n- src\r\n- gulp\r\n  - tasks\r\n    - javascript.js\r\n```\r\n\r\n\r\nIn the javascript.js I have following configuration\r\n```javascript\r\nvar projectRoot = process.env.PWD; // Absolute path to the project root\r\nvar resolveRoot = path.join(projectRoot, 'node_modules'); // project root/node_modules\r\n\r\nvar webpackConfig = {\r\n    context: config.src, // ./src\r\n    entry: {\r\n      a: './index'\r\n    },\r\n    output: {\r\n      path: config.javascript.dest, // ./dist\r\n      filename: '[name].entry.js'\r\n    },\r\n    plugins: [],\r\n    resolve: {\r\n      root: [\r\n        resolveRoot,\r\n        path.join(__dirname, 'node_modules')\r\n      ],\r\n      extensions: ['', '.js']\r\n    },\r\n    module: {\r\n      loaders: [\r\n        {\r\n          test: /\\.js$/,\r\n          exclude: /(node_modules|bower_components)/,\r\n          loader: 'babel-loader'\r\n        }\r\n      ]\r\n    }\r\n  };\r\n```\r\n\r\nWith this configuration, running by a gulp task, I always get\r\n```sh\r\nError: Cannot find module './node_modules/babel-loader/index.js'\r\n```\r\n\r\nI spent hours trying and trying, without results. I would be happy for a hint or help with this."},"comment":{"url":"https://api.github.com/repos/webpack/webpack/issues/comments/202862267","html_url":"https://github.com/webpack/webpack/issues/1260#issuecomment-202862267","issue_url":"https://api.github.com/repos/webpack/webpack/issues/1260","id":202862267,"user":{"login":"lykyd","id":4502048,"avatar_url":"https://avatars.githubusercontent.com/u/4502048?v=3","gravatar_id":"","url":"https://api.github.com/users/lykyd","html_url":"https://github.com/lykyd","followers_url":"https://api.github.com/users/lykyd/followers","following_url":"https://api.github.com/users/lykyd/following{/other_user}","gists_url":"https://api.github.com/users/lykyd/gists{/gist_id}","starred_url":"https://api.github.com/users/lykyd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lykyd/subscriptions","organizations_url":"https://api.github.com/users/lykyd/orgs","repos_url":"https://api.github.com/users/lykyd/repos","events_url":"https://api.github.com/users/lykyd/events{/privacy}","received_events_url":"https://api.github.com/users/lykyd/received_events","type":"User","site_admin":false},"created_at":"2016-03-29T12:13:43Z","updated_at":"2016-03-29T12:13:43Z","body":"I had a pretty similar issue using Grunt and Yeoman.\r\nI fixed it by adding in my Gruntfile.js :\r\n```\r\nconnect().use(\r\n   '/node_modules',\r\n   connect.static('./node_modules')\r\n),\r\n```\r\nin the ``connect`` declaration of the \"grunt serve\" process"}}