in

module build failed cannot find package @babelcore imported from babelindex.js


I have stuck on this problem for several days. I did some research but in vain.After “ng serve” terminal always reports:

> ./node_modules/@angular/router/fesm2020/router.mjs - Error: Module build failed (from ./node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js):
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'node_modules@angularcompiler-clinode_modules@babelcore' imported from node_modules@angularcompiler-clibundleslinkerbabelindex.js
Did you mean to import @babel/core/lib/index.js?
    at legacyMainResolve (internal/modules/esm/resolve.js:225:9)
    at packageResolve (internal/modules/esm/resolve.js:648:14)
    at moduleResolve (internal/modules/esm/resolve.js:696:18)
    at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:810:11)
    at Loader.resolve (internal/modules/esm/loader.js:88:40)
    at Loader.getModuleJob (internal/modules/esm/loader.js:241:28)
    at ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:56:40)
    at link (internal/modules/esm/module_job.js:55:36)

My package.json is like below:

"devDependencies": {
"@angular-devkit/build-angular": "^13.0.2",
"@angular/cli": "^13.0.2",
"@angular/compiler-cli": "~13.0.1",
"@babel/cli": "^7.16.8",
"@babel/core": "^7.16.7",
"@babel/node": "^7.16.8",
"@babel/preset-env": "^7.16.8",
"@types/file-saver": "^2.0.3",
"@types/jasmine": "~3.8.2",
"@types/node": "^16.7.10",
"@types/xlsx": "0.0.36",
"babel-loader": "^8.2.3",
"jasmine-core": "~3.8.0",
"karma": "~6.3.4",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.0.3",
"karma-jasmine": "~4.0.1",
"karma-jasmine-html-reporter": "~1.7.0",
"typescript": "~4.4.4",
"webpack": "^5.66.0"}

And my .babelrc is:

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

Would you please give me some advices? thank you!



Source: https://stackoverflow.com/questions/70723074/module-build-failed-cannot-find-package-babel-core-imported-from-babel-index

Logrus hook aliyun sls with golang

Texas scientists’ new Covid-19 vaccine is cheaper, easier to make and patent-free thumbnail

Texas scientists’ new Covid-19 vaccine is cheaper, easier to make and patent-free