Cannot find module ‘@babel/core’ error is a standard error with many node users. It’s related to placing script files and unpacking the node’s packages. See the following article to deal with it.
How Does The Error “Cannot find module ‘@babel/core’” Happen?
The error cannot find module ‘@babel/core’ occurs because your node does not have Babel installed.
Another reason you have installed Babel, but it still has this error is that Babel has upgraded to version 7 and changed the name of the node packages. So, when you use the old command line, it doesn’t work.
Command to install Babel from version 6 and earlier:
npm install @babel-core --save
When you run this command for Babel 7 and the latest versions, your node will not work and generate an error.
When running the build command in the index.js file, the program gives an error that cannot find module ‘@babel/core’, and the build fails.
Output:
ERROR in ./src/index.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: Cannot find module '@babel/core'
How To Solve The Error?
Option 1: Install @babel/core
To resolve the cannot find module ‘@babel/core’ error, you need to run the modified command on the terminal as follows
npm install @babel/core --save
Then let’s restart your ide and server after installing babel/core.
Option 2: Delete the old version and update it again
If the above instructions still do not fix the error, then you should delete the old version of babel/core and reinstall the latest version as follows:
- Uninstall Babel 6:
npm uninstall --save-dev babel-cli babel-core babel-polyfill babel-preset-es2015 babel-preset-stage-2 babel-register
- Reinstall Babel 7 or the latest version:
npm i --save-dev @babel/cli @babel/core @babel/node @babel/polyfill @babel/preset-env
- Restart your ide and server.
Then open your package.json file and check if it has @babel/core in devDependencies. If it shows like the following, then you have successfully installed it:
“devDependencies”: {
“@babel/cli”: “^7.13.16”,
“@babel/core”: “^7.13.16”,
“@babel/node”: “^7.13.13”,
“@babel/plugin-transform-runtime”: “^7.13.15”,
“@babel/preset-env”: “^7.13.15”,
“@babel/runtime”: “^7.13.17”
Summary
The “cannot find module ‘@babel/core’” error occurs when you have not installed Babel or installed it, but that has not been successful. Besides, installing Babel for your node must consider the version you want to install. For the new arrangements, the vendor has changed some codes. Then you must follow it for successful installation.
Maybe you are interested in similar errors:
- Cannot read properties of undefined
- Unexpected token u in JSON at position 0
- Uncaught SyntaxError Unexpected end of input
- ReferenceError: document is not defined

My name is Tom Joseph, and I work as a software engineer. I enjoy programming and passing on my experience. C, C++, JAVA, and Python are my strong programming languages that I can share with everyone. In addition, I have also developed projects using Javascript, html, css.
Job: Developer
Name of the university: UTC
Programming Languages: C, C++, Javascript, JAVA, python, html, css