zoukankan      html  css  js  c++  java
  • ionic报错: Failed to load resource

    隔了一天,才发现是代码写错了

    出错的原因是在ts 文件中使用这样的定义

     data: [] = ['高新区', '经开区', '其他园区'];

    错误在于这个定义的类型,不能是 [],修改成 any就没有问题了

     data: any = ['高新区', '经开区', '其他园区'];

    醉了 


    不知道怎么搞的,突然ionic报错: Failed to load resource 导致项目启动不起来

    该问题的最终解决办法是,把git项目重新克隆了一遍。所以今天并没有找到错误的原因

    记录解决过程

    发现这些丢失的文件都是在build目录下的

    所以执行build命令,但是报错如下:

    这个错误搞不懂,没搜到解决办法,于是想先删除了node_modules,在安装
    重新运行npm install命令 安装


    结果报错:从github下载超时

    Downloading binary from https://github.com/sass/node-sass/releases/download/v4.5.3/win32-x64-57_binding.node
    Cannot download "https://github.com/sass/node-sass/releases/download/v4.5.3/win32-x64-57_binding.node":
    
    connect ETIMEDOUT 54.231.49.194:443

    这里尝试了很多解决办法,终于可以下载了

    但是再返回执行 build命令,还是报错,绝望了

    [17:05:23]  ionic-app-script task: "build" 
    [17:05:23]  Error: Debug Failure. 
    Error: Debug Failure. 
        at typeToString (E:WorkspacesWebStormProjectguizhouApp
    ode_modules	ypescriptlib	ypescript.js:28777:22)
        at reportRelationError (E:WorkspacesWebStormProjectguizhouApp
    ode_modules	ypescriptlib	ypescript.js:34714:34)
        at isRelatedTo (E:WorkspacesWebStormProjectguizhouApp
    ode_modules	ypescriptlib	ypescript.js:34860:21)
        at checkTypeRelatedTo (E:WorkspacesWebStormProjectguizhouApp
    ode_modules	ypescriptlib	ypescript.js:34697:26)
        at checkTypeAssignableTo (E:WorkspacesWebStormProjectguizhouApp
    ode_modules	ypescriptlib	ypescript.js:34398:20)
        at checkVariableLikeDeclaration (E:WorkspacesWebStormProjectguizhouApp
    ode_modules	ypescriptlib	ypescript.js:44884:21)
        at checkPropertyDeclaration (E:WorkspacesWebStormProjectguizhouApp
    ode_modules	ypescriptlib	ypescript.js:43383:13)
        at checkSourceElement (E:WorkspacesWebStormProjectguizhouApp
    ode_modules	ypescriptlib	ypescript.js:46700:28)
        at Object.forEach (E:WorkspacesWebStormProjectguizhouApp
    ode_modules	ypescriptlib	ypescript.js:1506:30)
        at checkClassDeclaration (E:WorkspacesWebStormProjectguizhouApp
    ode_modules	ypescriptlib	ypescript.js:45765:16)
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! guizhouApp@0.0.1 build: `ionic-app-scripts build`
    npm ERR! Exit status 1
    npm ERR! 
    npm ERR! Failed at the guizhouApp@0.0.1 build script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     E:jiashubing
    pm_cache\_logs2017-12-28T09_05_23_905Z-debug.log
    View Code

      

  • 相关阅读:
    学长帮帮忙—Beta冲刺(4/7)
    学长帮帮忙—Beta冲刺(3/7)
    【二食堂】二食堂很难排队 博客目录
    【二食堂】Beta
    【二食堂】Beta
    【二食堂】Beta
    【二食堂】Beta
    【二食堂】Beta
    【二食堂】Beta
    【二食堂】Beta
  • 原文地址:https://www.cnblogs.com/acm-bingzi/p/ionicFailed.html
Copyright © 2011-2022 走看看