Pandiarajan
Pandiarajan

Reputation: 430

azure function app console - npm install doesn't work. Couldn't install agentkeepalive

I need to install agentkeepalive in azure functions. I was able to install other packages an hour ago. But as soon as I tried to install agentkeepalive, it doesn't honour any npm install command nor return any error messages in the console.

I tried this Cannot find module 'agentkeepalive' when updating NPM to 7.20.3 it is not working.

I restarted the azure function app and tried to install the package, no luck. Now I couldn't install any package. Help in installing the packages from this console. Thanks.

enter image description here

Upvotes: 0

Views: 1427

Answers (2)

anon
anon

Reputation:

In the Azure App Service Editor, the latest version will be 6.14.* because in app services the latest node version is 14v and the node.js 14 LTS npm latest version is 6.14.*. So though you try installing the latest version the npm still remains 6.14.*.

enter image description here

To install the npm install -g [email protected], it needs more than {"node":">= 8.0.0"}.

For doing that you need to update few settings from the Azure portal > <your-function-app> > configuration > settings tab from left pane. Below are the settings :

Name : `WEBSITE_NODE_DEFAULT_VERSION`
Value : 14.15.0

Name : `WEBSITE_RUN_FROM_PACKAGE`
Value : 0 [If published functions already]

Name : `FUNCTIONS_EXTENSION_VERSION`
Value : beta [optional]

enter image description here

Even if you update npm to the latest version, it will stay to the last version release i.e., 6.14.* Also, try changing your node version in your Azure App service for getting compatible error-free npm versions upgrade.

Below are the references for the NPM-Node Compatibility release versions to Azure App Services (Editor - Preview).

REFERENCES :

  1. Azure Functions Support for node.JS 14 and .Net 5 Is Generally Available.
  2. Node.js version 12.14.x be available on Azure App Services.

Upvotes: 1

Pandiarajan
Pandiarajan

Reputation: 430

I changed the node.js version in the azure portal and it started working. I think it just hung somewhere. Changing the version re-enabled or caused node.js restart. Here's the image attached. enter image description here

Upvotes: 0

Related Questions