Old npm version (1.1.37) on Windows Function App with Node.js runtime (v14.16.0)
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
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
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Azure/azure-functions-nodejs-worker
-
Handle valid prerelease Node.js versions without failing worker initializationPossibly taken @TsuyoshiUshio claimed this 54 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
area:nodejs-functions dependencies engineering tests
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Specialization race: double startApp() with stale require cache leaves worker on default v3 model with all functions unloadablePossibly taken @swapnil-nagar claimed this 59 days ago. Open
Difficulty 5/5 Over a week Newbie friendliness 30/100
Azure/azure-functions-nodejs-worker#838 · 1 comment ·
-
c-ares DNS misconfiguration on Windows Consumption causes mongodb+srv:// and dns.resolve*() failuresOpen
Difficulty 4/5 3-5 days Newbie friendliness 64/100
Azure/azure-functions-nodejs-worker#830 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
All issues in Azure/azure-functions-nodejs-worker
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
getsentry/sentry-conventions#732 · 1 comment ·
Maintainers usually reply within 1 day
-
status:in-linear status:team-assigned team:nodes
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
n8n-io/n8n#41548 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
motiondivision/motion#3955 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
equinor/prisma-decision-web#919 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 83/100