Cen
Cen

Reputation: 19

Kudu console hangs on npm install

I'm trying to use Azure Functions and want to add some dependencies to my code, then I followed step provided HERE. After running npm install and waited for quite a long time, the Kudu console just seems to hang and do nothing. I found this question but seems like I'm having a different problem.

Here is my package.json. Any ideas?

{
  "name": "dialogflowFulfillment",
  "description": "This is the fulfillment for a Dialogflow agents",
  "dependencies": {
    "actions-on-google": "2.0.0-alpha.4",
    "dialogflow": "^0.1.0",
    "dialogflow-fulfillment": "0.3.0-beta.3",
    "request": "^2.87.0"
  }
}

Upvotes: 2

Views: 1247

Answers (1)

Jerry Liu
Jerry Liu

Reputation: 17790

If your function app is on Consumption plan, check your WEBSITE_NODE_DEFAULT_VERSION in Application settings.

Npm installation hangs for 20m+ when node version is 6.5.0 on my side. After upgrading it to 8.11.1, this installation costs 6~7 minutes. And on App service plan, it costs less than 7m even though node version is v6.x.

This duration is not much ideal either, as it's a limitation of Azure Files, which has latency with multiple small files, see this comment. You can have a look at Azure function pack if needed.

Use function pack

  1. (If you develop online, download app content first) Delete old functions online.
  2. In your function app directory, npm install your packages locally.
  3. npm install -g azure-functions-pack to install function pack tool.
  4. funcpack pack -c . to place all the modules in a single file.
  5. Go to .funcpack folder and upload all content inside through kudu.
  6. Refresh your function app.

Upvotes: 1

Related Questions