周凯,个人博客

  • 前端
  • 嵌入式
  • 工具
  • 后端
  • 随笔
个人记录
  1. 首页
  2. 工具
  3. 正文

app分发平台

2022年 10月 29日 1086点热度 0人点赞 0条评论
  • 为方便公司内部 app 版本统一管理,根据开源项目本地部署: 开源地址

  • 采坑记录

    1.安装依赖报错

    internal/util/inspect.js:31
    
    const types = internalBinding('types');
    
    ReferenceError: internalBinding is not defined

    错误原因:这个问题是我将 node 版本升级至 v10.15.0,npm 升级至 6.4.1 后出现的,在此之前,我的 node 版本是 8+,没有出现这个问题。

    • 解决方案: 升级下 native 这个插件的版本即可

    ​ npm install natives@1.1.6

    • 错误原地址:地址

    2.pm2 启动后台服务报错

  • 解决方案: 在 server 根目录新增app.js,添加如下内容

    require("babel-register");
    require("babel-polyfill");
    require("./index.js");

    然后再执行pm2 start app.js即可

  • 解决方案原地址:地址

    3.nginx 配置 upload 文件下载 404

  • 正确配置:

    location / {
          try_files $uri $uri/ @router;
          index index.html;
          root /www/wwwroot/app.start6.cn/dist;
      }
    
      location /upload {
          #该root目录为根目录下config.json文件里dir目录 上传的apk和ipa文件当作静态文件处理
          alias /apk/upload;
    
      }
    
      location @router {  # vue的router配置
          rewrite ^.*$ /index.html last;
      }
    
      location /api/ {  #把以api打头的接口转发给后端server
        proxy_pass http://127.0.0.1:9898; #这里端口修改为后端服务运行的端口
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      }
      client_max_body_size 208M; #最大上传的ipa/apk文件大小

🎯 拓展阅读提示

本文涉及的内容已同步至公众号后台,我会在那里分享更多深度内容和实用技巧

→ 点击关注:一行梦境

公众号二维码
本作品采用 知识共享署名 4.0 国际许可协议 进行许可
标签: 暂无
最后更新:2022年 10月 29日

周凯

这个人很懒,什么都没留下

打赏 点赞
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

COPYRIGHT © 2022-现在 周凯,个人博客. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

蒙ICP备18004897号