Nikita Vlasenko
Nikita Vlasenko

Reputation: 4352

Yarn installation, Module build failed: Error: Couldn't find preset "es2015"

I need to use react-select: https://github.com/JedWatson/react-select For that I needed to first install yarn on Ubuntu 14.04. After the installation, and yarn add react-select I can not build my project anymore with webpack since it is giving me the error:

ERROR in ./views/index.js Module build failed: Error: Couldn't find preset "es2015" relative to directory "/home/nikita/Desktop/kipnis_prototype/client_side_BrainImmuneConnectome/brain-immune-connectome" at /home/nikita/Desktop/kipnis_prototype/client_side_BrainImmuneConnectome/brain-immune-connectome/node_modules/babel-core/lib/transformation/file/options/option-manager.js:293:19 at Array.map () at OptionManager.resolvePresets (/home/nikita/Desktop/kipnis_prototype/client_side_BrainImmuneConnectome/brain-immune-connectome/node_modules/babel-core/lib/transformation/file/options/option-manager.js:275:20) at OptionManager.mergePresets (/home/nikita/Desktop/kipnis_prototype/client_side_BrainImmuneConnectome/brain-immune-connectome/node_modules/babel-core/lib/transformation/file/options/option-manager.js:264:10) at OptionManager.mergeOptions (/home/nikita/Desktop/kipnis_prototype/client_side_BrainImmuneConnectome/brain-immune-connectome/node_modules/babel-core/lib/transformation/file/options/option-manager.js:249:14) at OptionManager.init (/home/nikita/Desktop/kipnis_prototype/client_side_BrainImmuneConnectome/brain-immune-connectome/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12) at File.initOptions (/home/nikita/Desktop/kipnis_prototype/client_side_BrainImmuneConnectome/brain-immune-connectome/node_modules/babel-core/lib/transformation/file/index.js:212:65) at new File (/home/nikita/Desktop/kipnis_prototype/client_side_BrainImmuneConnectome/brain-immune-connectome/node_modules/babel-core/lib/transformation/file/index.js:135:24) at Pipeline.transform (/home/nikita/Desktop/kipnis_prototype/client_side_BrainImmuneConnectome/brain-immune-connectome/node_modules/babel-core/lib/transformation/pipeline.js:46:16) at transpile (/home/nikita/Desktop/kipnis_prototype/client_side_BrainImmuneConnectome/brain-immune-connectome/node_modules/babel-loader/lib/index.js:50:20) at /home/nikita/Desktop/kipnis_prototype/client_side_BrainImmuneConnectome/brain-immune-connectome/node_modules/babel-loader/lib/fs-cache.js:118:18 at ReadFileContext.callback (/home/nikita/Desktop/kipnis_prototype/client_side_BrainImmuneConnectome/brain-immune-connectome/node_modules/babel-loader/lib/fs-cache.js:31:21) at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:437:13) npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! [email protected] webpack: webpack npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the [email protected] webpack script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /home/nikita/.npm/_logs/2018-06-07T04_11_30_458Z-debug.log

I have presents installed in .babelrc file:

{
  "presets": ["es2015", "react", "stage-1"]
}

So, the solutions that I found here:

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

are not working. What is going wrong here? How could it be fixed?

Upvotes: 0

Views: 1046

Answers (1)

Nikita Vlasenko
Nikita Vlasenko

Reputation: 4352

I found the solution here:

https://github.com/babel/gulp-babel/issues/93

Doing the following:

npm i babel-preset-es2015
npm i babel-preset-stage-2

Solved the issue.

Upvotes: 1

Related Questions