2

I have a standard Azure App Service and I'm trying to run a node rest api from it. I've had nothing but troubles from the very start.

Going into kudu to check what node versions are supported, the only supported node version listed is "nodejs":[{"version":"0.10.40" but I added the env variable where I specified node version 8.4 and it seems to be supported and when I run node --version it gives me 8.4 but that kudu config hasn't changed.

For some reason -- it doesn't install the packages right, I looked for 'body-parser' in the node_modules folder and it is not there even if its listed in package.json as direct dependency.

Running npm install or npm install body-parser all time-out with no real reason.

Running npm install as part of the devops release deployment cycle runs in 17 secondsbut it ends up saying 'up to date'

Judging by the mismatches between kudu's runtime file, the node version mismatch I think there's something seriously wrong with my app's config.

I'm running off a pay-as-you-go subscription using the Basic tier with 100 units.

This is a freshly installed app powering absolutely nothing.

SebastianG
  • 8,563
  • 8
  • 47
  • 111

1 Answers1

1

First, please make sure that you have set the WEBSITE_NODE_DEFAULT_VERSION value in tab Application settings tab of your WebApp on Azure portal to enable the Node version what you want, as the figure below to use Node version 10.14.1.

enter image description here

Then, you can check it via commands node -v & npm -v in Kudu console.

enter image description here

I tried to install body-parser package in the directory node-test created by me via command npm install body-parser. Although there is some warn messages due to missing some files like package.json, the body-parser package has existed under the node-modules.

enter image description here

enter image description here

Peter Pan
  • 23,476
  • 4
  • 25
  • 43
  • that's exactly what I ended up doing but didn't come back to update. The timeouts were happening when I was accessing the console using the dashboard console for the app, once I went into powershell via kudu it seems to be much more responsive. It also seems that npm install runs well now after deployment from the pipeline and installs all dependencies. Everything works well so far & I'm about to deploy a version worthy of production in the next few hours to test things out more. The only issue that semed was finding the compatible 10.14.1 version of node to set as env variable. – SebastianG Apr 03 '19 at 10:26