Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Old npm version (1.1.37) on Windows Function App with Node.js runtime (v14.16.0)

Open
#479 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
azure, node.js, typescript
Domain
backend, cloud

Research direction

Start by reproducing the Windows Function App with the provided az functionapp create command and inspect node --version and npm --version in the function logs, then compare the runtime diagnostics endpoint. Done means the Node.js 14.16.0 runtime exposes the expected npm 6.14.11 version and npm scripts run correctly.

Written by the indexing model from the issue text.

Description

App Service area:nodejs-functions enhancement P2

In Azure Function App running in Windows OS with Node.js runtime in Azure Cloud, when Node.js version is v14.16.0, npm is very very old version 1.1.37.

It should be like this (Kudu App service https://<app-name>.scm.azurewebsites.net/api/diagnostics/runtime):


{
  "nodejs": [
    {
      "version": "14.16.0",
      "npm": "6.14.11"
    },

It is clearly shown by this code that npm version is wrong in runtime of Azure Function:

➜ az functionapp create \
        --name david-test-safe-to-delete-... \
        --resource-group ... \
        --subscription ... \
        --storage-account ... \
        --consumption-plan-location eastus \
        --disable-app-insights true \
        --os-type Windows \
        --runtime node \
        --runtime-version 14 \
        --functions-version 3
import { AzureFunction, Context } from "@azure/functions"
const timerTrigger: AzureFunction = async function (context: Context, myTimer: any): Promise<void> {
    const util = require('util');
    const exec = util.promisify(require('child_process').exec);
    try {
        await executeCommand("node --version");
        await executeCommand("npm --version");
    } catch (error) {
        context.log(`Function failed ${error}`)
    }

    async function executeCommand(cmd: string) {
        context.log("Starting showing logs using context.log command");
        context.log(`executeCommand("${cmd}")`);
        const { stdout, stderr } = await exec(cmd, { stdio: 'inherit' });
        context.log('stdout:', stdout);
        context.log('stderr:', stderr);
        context.log(`End showing logs using context.log command`);
    }
}
export default timerTrigger
2021-11-25T11:51:40.195 [Information] Starting showing logs using context.log command
2021-11-25T11:51:40.220 [Information] executeCommand("node --version")
2021-11-25T11:51:40.709 [Information] stdout: v14.16.0
2021-11-25T11:51:40.728 [Information] stderr:
2021-11-25T11:51:40.728 [Information] End showing logs using context.log command
2021-11-25T11:51:40.728 [Information] Starting showing logs using context.log command
2021-11-25T11:51:40.728 [Information] executeCommand("npm --version")
2021-11-25T11:51:41.628 [Information] stdout: 1.1.37
2021-11-25T11:51:41.644 [Information] stderr:
2021-11-25T11:51:41.644 [Information] End showing logs using context.log command

I can not execute some npm scripts because npm is not working as expected...

Dominant language
TypeScript
Stars
110
Forks
52
Avg merge
7h 33m
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Azure/azure-functions-nodejs-worker

All issues in Azure/azure-functions-nodejs-worker

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.