Reputation: 114
I am fairly new to NodeJS development. I have no issues whatsoever running commands on my local machine. For instance, say I want to install a package called "formidable" on my Node server, I'd run the command 'npm install formidable'. If I have deployed my NodeJS application to Azure, how would I run the same command?
NB - I do not want to manually run the command on my local machine and then deploy to Azure. This will take far too long, since I have to install many packages each with many files in them.
Please advise on how I go about doing this?
Thanks
Upvotes: 0
Views: 1746
Reputation: 13918
Beside login KUDU console site and run command in online cmdlet. You also can configure dependencies in package.json
, then you deploy your nodejs application to Azure via GIT, it will automatically install the dependencies in this file.
For example:
You add the formidable
module in dependencies:
Then deploy it application on Azure Web Apps, you can see the remoting deployment logs in cmdlet that the module was added in the application on Azure, e.g.:
You can refer to Create a Node.js web app in Azure App Service for how to create a nodejs application and deploy via GIT.
Upvotes: 2
Reputation: 1805
If you are running an Azure Web App you can use Kudu Services.
To do this
You can run your npm commands from there.
Screen shot below
More information can be found here: https://github.com/projectkudu/kudu/wiki
Upvotes: 1