zoukankan      html  css  js  c++  java
  • angular 升级到angular8 以及报错信息解决

    1.升级全局angular-cli

    npm install -g @angular/cli@latest
    

      

    2.升级项目内 angular-cli

    (在需要升级的项目中运行)

    npm i @angular/cli@latest
    

      

    3.升级剩下的所有组件

    ng update --all  --force
    

    4.更新所有需要安装的组件

    (在需要升级的项目下)

    npm i
    

     

    如果出现报错信息类似于如下这种

    ERROR in ./src/polyfills.ts
    Module not found: Error: Can't resolve 'core-js/es6/array' in 'C:CoddingWorkspacevehicle_insurance_pcsrc'
    ERROR in ./src/polyfills.ts
    Module not found: Error: Can't resolve 'core-js/es6/date' in 'C:CoddingWorkspacevehicle_insurance_pcsrc'
    ERROR in ./src/polyfills.ts
    Module not found: Error: Can't resolve 'core-js/es6/function' in 'C:CoddingWorkspacevehicle_insurance_pcsrc'
    ERROR in ./src/polyfills.ts
    Module not found: Error: Can't resolve 'core-js/es6/map' in 'C:CoddingWorkspacevehicle_insurance_pcsrc'
    ERROR in ./src/polyfills.ts
    Module not found: Error: Can't resolve 'core-js/es6/math' in 'C:CoddingWorkspacevehicle_insurance_pcsrc'
    ERROR in ./src/polyfills.ts
    Module not found: Error: Can't resolve 'core-js/es6/number' in 'C:CoddingWorkspacevehicle_insurance_pcsrc'
    ERROR in ./src/polyfills.ts
    Module not found: Error: Can't resolve 'core-js/es6/object' in 'C:CoddingWorkspacevehicle_insurance_pcsrc'
    ERROR in ./src/polyfills.ts
    Module not found: Error: Can't resolve 'core-js/es6/parse-float' in 'C:CoddingWorkspacevehicle_insurance_pcsrc'
    ERROR in ./src/polyfills.ts
    Module not found: Error: Can't resolve 'core-js/es6/parse-int' in 'C:CoddingWorkspacevehicle_insurance_pcsrc'
    ERROR in ./src/polyfills.ts
    Module not found: Error: Can't resolve 'core-js/es6/regexp' in 'C:CoddingWorkspacevehicle_insurance_pcsrc'
    ERROR in ./src/polyfills.ts
    Module not found: Error: Can't resolve 'core-js/es6/set' in 'C:CoddingWorkspacevehicle_insurance_pcsrc'
    ERROR in ./src/polyfills.ts
    Module not found: Error: Can't resolve 'core-js/es6/string' in 'C:CoddingWorkspacevehicle_insurance_pcsrc'
    ERROR in ./src/polyfills.ts
    Module not found: Error: Can't resolve 'core-js/es6/symbol' in 'C:CoddingWorkspacevehicle_insurance_pcsrc'
    ERROR in ./src/polyfills.ts
    Module not found: Error: Can't resolve 'core-js/es6/weak-map' in 'C:CoddingWorkspacevehicle_insurance_pcsrc'

    进入polyfills.ts 更改引入路径为如下即可

    import 'core-js/features/symbol';
    import 'core-js/features/object';
    import 'core-js/features/function';
    import 'core-js/features/parse-int';
    import 'core-js/features/parse-float';
    import 'core-js/features/number';
    import 'core-js/features/math';
    import 'core-js/features/string';
    import 'core-js/features/date';
    import 'core-js/features/array';
    import 'core-js/features/regexp';
    import 'core-js/features/map';
    import 'core-js/features/weak-map';
    import 'core-js/features/set';

    import 'core-js/proposals/reflect-metadata';

      

  • 相关阅读:
    Python相关数据结构的排序
    使用OpenCV和Python构建运动热图视频
    使用AI来检测违反社交距离的行为
    基于Python、Keras和OpenCV的实时人脸活体检测
    每个人都应该知道的十大OpenCV函数
    入门用Python进行Web爬取数据:为数据科学项目提取数据的有效方法
    入门深度学习?这里有5件你应该知道的事
    基于YoloV3卫星图像的储油罐容积占用率研究
    生产中的NLP:创建Docker镜像
    使用Python可视化Word2vec的结果
  • 原文地址:https://www.cnblogs.com/MainActivity/p/11236099.html
Copyright © 2011-2022 走看看