nulIptr
V2EX  ›  问与答

看 Jenkins 每次都会执行 npm install,有没有简单的办法对比 package.json 的变更来决定要不要执行这个 stage 呢

  •  
  •   nulIptr · Nov 12, 2020 · 2215 views
    This topic created in 2010 days ago, the information mentioned may be changed or developed.
    4 replies    2020-11-13 15:01:41 +08:00
    FrancisZ
        1
    FrancisZ  
       Nov 12, 2020 via Android
    除非你把 node_modules 上传,要不然怎么编译打包?
    h82258652
        2
    h82258652  
       Nov 12, 2020
    yarn 可以解决。不过其实重新执行是有道理的,每次构建开始时都必须确保环境是干净的。
    Ariver
        3
    Ariver  
       Nov 12, 2020
    你可以在 Jenkins 所在本地网络搞一个 repo
    julyclyde
        4
    julyclyde  
       Nov 13, 2020
    可以搞一个服务于下载阶段的缓存
    但是 npm install 肯定是要执行的,要不然里面岂不是缺文件?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   987 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 18:57 · PVG 02:57 · LAX 11:57 · JFK 14:57
    ♥ Do have faith in what you're doing.