I have setup Angular 6 project.
I am trying to run ng build --prod but I am getting below error
Module not found: Error: Can't resolve 'core-js/es7/reflect' in 'c:\localpath'
I am getting this error Angular 6 CLI version.
I think you got this error because you are using -aot compiler.
What you need here is open the polyfill.ts and comment the import 'core-js/es7/reflect'.
/** Evergreen browsers require these. **/
// Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.
//import 'core-js/es7/reflect';
Hope this will help
You can change 'es7' to 'es' as mentioned here, for me this worked:
import 'core-js/es/reflect';
But then I got
Error: Can't resolve 'core-js/es/global'
Then I noticed the version of my core-js was different from the one in the project, so I installed the specific version of core-js needed:
npm install --save core-js@^2.5.0
Hope one of these will solve your problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With