IsaacYoung
V2EX  ›  Node.js

nodejs 依赖不同平台怎么处理?

  •  
  •   IsaacYoung · Mar 25, 2019 · 4976 views
    This topic created in 2787 days ago, the information mentioned may be changed or developed.

    环境

    本地:macOS

    生产环境:linux,无法访问外网不能 npm install

    由于生产环境无法 npm install,所以我把本地的 node_modeules 也加入了 git

    问题

    有一个依赖包,darwin 和 linux 不是通用的,生产环境无法正常运行,请问怎么处理?

    5 replies  •  2019-04-03 18:20:28 +08:00
    qwertyegg
    qwertyegg
    Mar 25, 2019
    1
    Linus 都说了,开发环境要和生产环境一样,上虚拟机吧

    https://www.realworldtech.com/forum/?threadid=183440&curpostid=183486
    fkmc
    fkmc
    Mar 25, 2019
    2
    ?测试环境
    测试环境打包好 发布到生产环境 不是基本操作?
    Vogan
    Vogan
    Mar 25, 2019 via iPhone
    3
    你需要一个 linux 的预发环境
    knightlhs
    knightlhs
    Mar 25, 2019❤️2
    4
    你需要 docker
    shakaraka
    shakaraka
    Apr 3, 2019
    5
    docker+1
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   986 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 22:07 · PVG 06:07 · LAX 14:07 · JFK 17:07
    ♥ Do have faith in what you're doing.