Error: Can't resolve 'core-js/es7/reflect' in '\node_modules\@angular-devkit\build-angular\src\angular-cli-files\models
You should install [email protected]
that contains this file/module. See preset-env docs.
If you'd like to use version 3.0, you can add the a path to your tsconfig.json
file.
{
"compilerOptions": {
...
"paths": {
"core-js/es7/reflect": [
"node_modules/core-js/proposals/reflect-metadata"
]
}
}
}
Note: You need check the node_modules/core-js/proposals/reflect-metadata
relative path and correct it if needed in your project structure.
For Angular 8 (source):
Angular CLI 8.0+ manages the required Angular polyfills directly and projects will not require a direct dependency on core-js (assuming an application does not manually include additional core-js polyfills).
I've resolved by:
- removing
core-js
from mypackage.json
dependencies - removing
import 'core-js/es7/reflect';
from mytest.ts
The version 3.0 of core-js has some breaking changes:
https://github.com/zloirock/core-js/blob/master/docs/2019-03-19-core-js-3-babel-and-a-look-into-the-future.md
You should find a line similar to this in one of your files: import "core-js/es7/reflect";
Change it to this: import "core-js/proposals/reflect-metadata";
In my case , i just changed -->
import 'core-js/es6/reflect';
import 'core-js/es7/reflect';
to
import 'core-js/es/reflect';
and it worked..