question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Module not found: Error: Cannot resolve module 'babel-loader'

See original GitHub issue

I’m using webpack in directory /users/path/a/(it holds the webpack.config.js) and compile files in directlry /another/path/b/. I run gulp webpack task in path a, and it will compile all the files in path b using absolute path.

Then I got Cannot resolve module 'babel-loader' error.

After looking at https://github.com/webpack/webpack/issues/784, I tried resolve.fallback, resolve.root, but neither works. Thanks for all kinds of help.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:55
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

158reactions
kevireillycommented, Feb 23, 2016

For those looking to have some copy pasta:

resolveLoader: {
  root: path.join(__dirname, 'node_modules')
}

Pulled from the docs and the image as posted by @camsong. Thanks for figuring it out.

46reactions
camsongcommented, May 20, 2015

Finally I tried resolveLoader and it works. My configuration is as follows:

resolveLoader: {
      modulesDirectories: [
          '/users/path/a/node_modules'
      ]
},
Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Cannot resolve module 'babel-loader' - Stack Overflow
When I run the command locally I get no issues. Below is my webpack config - i have tried using resolveLoader to fix...
Read more >
babel-loader - webpack
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >
babel-loader - npm
babel module loader for webpack. ... the default OS temporary file directory if no node_modules folder could be found in any root directory....
Read more >
Can't resolve fs - Help Requests - The Aurelia Discourse
node_modules/jsdom/lib/jsdom/utils.js Module not found: Error: Can't resolve ... since I haven't done anything with the babel loader or the jsdom itself.
Read more >
sage - Roots Discourse
ModuleNotFoundError : Module not found: Error: Can't resolve ... /web/app/themes/exaltsaude/node_modules/babel-loader/lib/index.js' in ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found