Categories
JavaScript Answers

How to fix Cannot find module babel-preset-es2015 error with JavaScript?

Spread the love

To fix Cannot find module babel-preset-es2015 error with JavaScript, we install the @babel/preset-env package.

To install it, we run

npm install --save-dev @babel/preset-env

to install the package.

Then in .babelrc, we write

{
  "presets": ["@babel/preset-env"]
}

to add the preset.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published.