1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

Azure App Service: Extracting a 60MB node_modules ZIP takes longer than running npm install —...

Discussão em 'Angular' iniciado por Shaan, Novembro 25, 2025.

  1. Shaan

    Shaan Guest

    I have an automated deployment tool that generates a React or Angular project, uploads it to Azure App Service, and then restores node_modules to reduce build time.

    To avoid running npm install on every deployment, I store a prebuilt node_modules.zip (~60 MB) in Azure Blob Storage.
    My workflow is:


    1. Download node_modules.zip


    2. Extract it inside Kudu (App Service console) under /tmp/...


    3. Copy the extracted folder to /home/site/wwwroot/<project>/node_modules

    The problem:
    Extracting + copying this ZIP takes more time than running npm install, even though the whole idea was to speed up deployment.

    What I tried


    • Using node_modules.zip


    • Extracting to /tmp then copying to the project directory


    • Trying different unzip packages (unzipper, adm-zip, etc.)


    • Using Kudu console and Azure CLI
    Issues Observed


    • Azure App Service file system is slow with thousands of small files


    • Zip extraction of node_modules is extremely slow


    • Copying the folder doubles the delay


    • End result: npm install actually finishes faster

      My Question

      How can I speed up the node_modules restore process on Azure App Service?

      I want to avoid running npm install every time, but extracting a ZIP of node_modules is even slower. What’s the best practice to quickly restore dependencies on Azure App Service?

      Additional Notes

      • App Service is Linux-based


      • Deployment tool is using Node.js


      • React and Angular builds are working, this issue is only with node_modules restore


      • I am open to alternatives like tar.gz, npm cache, npm ci, etc.
      What I am looking for

      • Better format to store node_modules (tar.gz?)


      • Faster extraction method


      • Extract directly to destination without copy?


      • Alternative approaches (npm cache or npm ci)


      • Any best practices for dependency restore in Azure App Services

    Continue reading...

Compartilhe esta Página