Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix Error cannot find module 'core-js/es6'

I have been getting an error regardless of what I do. In fact I am building an app with mongoDB as a server using mongoose and babel-watch, but every time I run babel-watch I get this error:

Error cannot find module 'core-js/es6'

I have installed and reinstalled core.js using npm install core.js, however nothing changes. Please help.

These are the dependencies I have installed on my project:

"dependencies": {
    "body-parser": "^1.19.0",
    "core-js": "^2.6",
    "cuid": "^2.1.6",
    "express": "^4.17.1",
    "limax": "^1.7.0",
    "mongoose": "^5.6.9",
    "node-gyp": "^5.0.3"
  },
  "devDependencies": {
    "babel-cli": "^6.26.0",
    "babel-core": "^6.26.3",
    "babel-loader": "^8.0.6",
    "babel-polyfill": "^6.26.0",
    "babel-preset-env": "^1.7.0",
    "babel-preset-es2015": "^6.24.1",
    "babel-preset-stage-0": "^6.24.1",
    "babel-watch": "^7.0.0",
    "nodemon": "^1.19.1"
  }
}

Code error seen from terminal after running npm start

like image 305
bstwagir Avatar asked Feb 24 '26 21:02

bstwagir


1 Answers

For core.js v3.9 import in App.tsx the next line: import "core-js/es";

like image 97
Wasyster Avatar answered Feb 27 '26 15:02

Wasyster



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!