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';

      

  • 相关阅读:
    UTF-8 GBK UTF8 GB2312 之间的区别和关系
    为什么要需求分析
    数据库建表原则
    使用SQL存储过程有什么好处 用视图有什么好处
    SQL使用视图的优缺点
    百度地图添加多个行政区划
    性能测试日志分析之awk基础用法
    Nginx 安装配置
    linux的top命令参数详解
    Java小程序Linux下运行
  • 原文地址:https://www.cnblogs.com/MainActivity/p/11236099.html
Copyright © 2011-2022 走看看