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.

Error: Couldn't find preset "airbnb" relative to directory

See original GitHub issue

What error is this? How to solve? Why no info about it in docs?

ERROR in ./~/react-dates/index.js
    Module build failed: Error: Couldn't find preset "airbnb" relative to directory "C:\\Users\\user\\app\\node_modules\\react-dates"
        at C:\Users\user\app\node_modules\babel-core\lib\transformation\file\options\option-manager.js:293:19
        at Array.map (native)
        at OptionManager.resolvePresets (C:\Users\user\app\node_modules\babel-core\lib\transformation\file\options\option-manager.js:275:20)
        at OptionManager.mergePresets (C:\Users\user\app\node_modules\babel-core\lib\transformation\file\options\option-manager.js:264:10)
        at OptionManager.mergeOptions (C:\Users\user\app\node_modules\babel-core\lib\transformation\file\options\option-manager.js:249:14)
        at OptionManager.init (C:\Users\user\app\node_modules\babel-core\lib\transformation\file\options\option-manager.js:368:12)
        at File.initOptions (C:\Users\user\app\node_modules\babel-core\lib\transformation\file\index.js:212:65)
        at new File (C:\Users\user\app\node_modules\babel-core\lib\transformation\file\index.js:135:24)
        at Pipeline.transform (C:\Users\user\app\node_modules\babel-core\lib\transformation\pipeline.js:46:16)
        at transpile (C:\Users\user\app\node_modules\babel-loader\lib\index.js:46:20)
        at C:\Users\user\app\node_modules\babel-loader\lib\fs-cache.js:79:18
        at ReadFileContext.callback (C:\Users\user\app\node_modules\babel-loader\lib\fs-cache.js:15:14)
        at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:365:13)
     @ ./src/js/DatePicker.js 1:536-558
     @ ./src/js/widget.js

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
Gorden-Wangcommented, Apr 18, 2017

Great ! Done~ @ljharb I add exclude in babel-loader , and it solved


module: {
    rules: [{
      test: /\.(js|jsx)$/,
      loader: 'babel-loader',
      exclude: /node_modules/,
      options: {
        presets: ['es2015','react','stage-0'],
        plugins : [["import", {
          "libraryName": "antd",
          "libraryDirectory": "lib",   // default: lib
          "style": false
        },]]
      }


    }
1reaction
ljharbcommented, Apr 17, 2017

That looks like a bug in webpack dev server; it shouldn’t be trying to Babel transform anything in node_modules.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Couldn't find preset "airbnb" relative to directory - Stack Overflow
but it still gives me the same error. The .babelrc file is on the same level as the package.json file. I've searched everywhere...
Read more >
Error: Couldn't find preset "airbnb" relative to directory #435
Hi @wzup, can you check your node_modules folder for babel-preset-airbnb ? It seems like your npm install did not complete for some reason....
Read more >
[Solved]-Couldn't find preset "airbnb" relative to directory-Reactjs
Coding example for the question Couldn't find preset "airbnb" relative to directory-Reactjs.
Read more >
API Troublehsooting guide - Airbnb
Here are some of the frequently asked questions that we receive from hosts. If you do not find what you are looking for...
Read more >
Configuration Files - ESLint - Pluggable JavaScript Linter
If there is a .eslintrc and a package.json file found in the same directory, .eslintrc takes priority and the package.json file is not...
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