Aleksey Kontsevich Aleksey Kontsevich - 1 year ago 81
Git Question

NodeJS application deployment issue

Deployed NodeJS application to Azure from VS Code like mentioned here: Deploy NodeJS app to Azure from VS Code successfully - first initial commit:

$ git push azure master
remote: Updating branch 'master'.
remote: Updating submodules.

Then added
module to


npm added
"dotenv-extended": "^2.0.1"
file. After that committed, pushed to github, then pushed to azure same way like above.

However in 2nd time Azure did not perform submodules update and
was not installed on Azure in
which is added to
on my side. This caused application exception so forced to go to azure and run
npm install dotenv-extended
npm update

In 3rd time deployment Azure printed:

remote: Updating branch 'master'.
remote: Updating submodules.
remote: npm WARN [email protected] No description
remote: removed 15 packages in 31.134s
remote: npm WARN [email protected] No repository field.

and when I checked
was erased again even if I installed it manually previously.

  • Why did this happen, why azure did not run
    remote: Updating submodules
    in second time?

  • How to fix this if I need to add some modules later?

  • Is it possible to fix or extend some post-deployment script on Azure to add
    npm update

  • Or install them manually which is not good?

  • Or there is another way to deploy without git?

P.S. Think proposed solution
Git push to azure websites with submodule will not work as Git Azure
erases modules for some reason.

Answer Source

Seems some Azure issue. Following sequence helped me to solve the issue:

  • Go to App Service Editor in Azure,
  • Open Console there
  • Execute
    • npm install npm -g for latest npm
    • After this got another exception running my app: Error: Cannot find module 'async' - same bug as I got with 'dotenv-extended'.
    • npm install async

Works fine now after all of above. People suggest to commit package-lock.json, however this solution had not helped me: Azure deployment script uninstalled async and I got above error.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download