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.*
.

To install the npm install -g npm@7.20.3
, 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]

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 :
- Azure Functions Support for node.JS 14 and .Net 5 Is Generally Available.
- Node.js version 12.14.x be available on Azure App Services.