Kudu Script: remote: select node version failed

%3CLINGO-SUB%20id%3D%22lingo-sub-1589204%22%20slang%3D%22en-US%22%3EKudu%20Script%3A%20remote%3A%20select%20node%20version%20failed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1589204%22%20slang%3D%22en-US%22%3E%3CP%3EIt%20feels%20like%20Kudu%20doesn't%20want%20me%20to%20deploy%20my%20node.js%20app%20to%20Azure.%20I%20have%20done%20every%20thing.%3C%2FP%3E%3CP%3ESet%20WEBSITE_NODE_DEFAULT_VERSION%20on%20Application%20Settings%20in%20Portal%3C%2FP%3E%3CP%3Eadded%20%22node%22%3A%20%2212.16.3%22%20to%20package.json%3C%2FP%3E%3CP%3Eaz%20webapp%20config%20show%20xxxx%20--query%20linuxFxVersion%20shows%20%22NODE%7C12-lts%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EStill%20when%20I%20push%20my%20code%20to%20azure%20(git%20push%20azure%20master)%20I%20get%20the%20following%20log%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3EEnumerating%20objects%3A%205%2C%20done.%0ACounting%20objects%3A%20100%25%20(5%2F5)%2C%20done.%0ADelta%20compression%20using%20up%20to%204%20threads%0ACompressing%20objects%3A%20100%25%20(3%2F3)%2C%20done.%0AWriting%20objects%3A%20100%25%20(3%2F3)%2C%20311%20bytes%20%7C%20311.00%20KiB%2Fs%2C%20done.%0ATotal%203%20(delta%202)%2C%20reused%200%20(delta%200)%0Aremote%3A%20Deploy%20Async%0Aremote%3A%20Updating%20branch%20'master'.%0Aremote%3A%20Updating%20submodules.%0Aremote%3A%20Preparing%20deployment%20for%20commit%20id%20'0f3accad99'.%0Aremote%3A%20Running%20custom%20deployment%20command...%0Aremote%3A%20Not%20setting%20execute%20permissions%20for%20bash%20deploy.sh%0Aremote%3A%20Running%20deployment%20command...%0Aremote%3A%20ENOENT%3A%20no%20such%20file%20or%20directory%2C%20open%20'%2Fopt%2Fnodejs%2F12.16.3%2Fnpm.txt'%0Aremote%3A%20Handling%20node.js%20deployment.%0Aremote%3A%20Kudu%20sync%20from%3A%20'%2Fhome%2Fsite%2Frepository'%20to%3A%20'%2Fhome%2Fsite%2Fwwwroot'%0Aremote%3A%20Ignoring%3A%20.deployment%0Aremote%3A%20Ignoring%3A%20deploy.sh%0Aremote%3A%20Copying%20file%3A%20'package.json'%0Aremote%3A%20Ignoring%3A%20.git%0Aremote%3A%20Detecting%20node%20version%20spec...%0Aremote%3A%20Using%20package.json%20engines.node%20value%3A%2012.16.3%0Aremote%3A%20Node.js%20versions%20available%20on%20the%20platform%20are%3A%204.4.7%2C%204.5.0%2C%204.8.0%2C%206.2.2%2C%206.6.0%2C%206.9.3%2C%206.10.3%2C%206.11.0%2C%206.17.1%2C%208.0.0%2C%208.1.4%2C%208.2.1%2C%208.8.1%2C%208.9.4%2C%208.11.2%2C%208.12.0%2C%208.15.1%2C%208.17.0%2C%209.4.0%2C%2010.1.0%2C%2010.10.0%2C%2010.14.2%2C%2010.16.3%2C%2010.19.0%2C%2012.16.3%2C%2014.0.0.%0Aremote%3A%20Resolved%20to%20version%2012.16.3%0Aremote%3A%20Detecting%20npm%20version%20spec...%0Aremote%3A%20An%20error%20has%20occurred%20during%20web%20site%20deployment.%0Aremote%3A%20select%20node%20version%20failed%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EHere's%20what%20baffles%20me.%20from%20the%20logs%3C%2FP%3E%3CP%3E1.%20Ignoring%20scriipt%3C%2FP%3E%3CP%3Eremote%3A%20Ignoring%3A%20.deployment%3CBR%20%2F%3Eremote%3A%20Ignoring%3A%20deploy.sh%3C%2FP%3E%3CP%3EI%20read%20somewhere%20that%20this%20may%20happen%20if%20i%20edited%20the%20file.%20I%20deleted%20what%20i%20typed%20and%20regenerated%20it.%20Still%20I%20get%20this%20issue%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E2.%20Node%20version%20remote%3A%20Using%20package.json%20engines.node%20value%3A%2012.16.3%3C%2FP%3E%3CP%3Eremote%3A%20Resolved%20to%20version%2012.16.3%3C%2FP%3E%3CP%3Eremote%3A%20Detecting%20npm%20version%20spec...%3C%2FP%3E%3CP%3Eremote%3A%20An%20error%20has%20occurred%20during%20web%20site%20deployment.%3C%2FP%3E%3CP%3Eremote%3A%20select%20node%20version%20failed%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhy%20did%20it%20fail%3F%20I%20am%20at%20a%20loss.%20I%20don't%20know%20how%20to%20proceed.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2007986%22%20slang%3D%22en-US%22%3ERe%3A%20Kudu%20Script%3A%20remote%3A%20select%20node%20version%20failed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2007986%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F759821%22%20target%3D%22_blank%22%3E%40jijodev%3C%2FA%3Esame%20problem%20here%2C%20I%20still%20looking%20for%20a%20solution%2C%20there's%20also%20an%20issue%20opened%20two%20years%20ago%20on%20kudu%20on%20github%2C%20and%20there's%20no%20answer.%20I%20think%20the%20best%20thing%20to%20do%20is%20to%20moving%20away%20from%20azure%20app%20service%20and%20using%20something%20more%20reliable.%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fprojectkudu%2Fkudu%2Fissues%2F2870%23issuecomment-443464291%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fprojectkudu%2Fkudu%2Fissues%2F2870%23issuecomment-443464291%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

It feels like Kudu doesn't want me to deploy my node.js app to Azure. I have done every thing.

Set WEBSITE_NODE_DEFAULT_VERSION on Application Settings in Portal

added "node": "12.16.3" to package.json

az webapp config show xxxx --query linuxFxVersion shows "NODE|12-lts"

 

Still when I push my code to azure (git push azure master) I get the following log

Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 4 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 311 bytes | 311.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: Deploy Async
remote: Updating branch 'master'.
remote: Updating submodules.
remote: Preparing deployment for commit id '0f3accad99'.
remote: Running custom deployment command...
remote: Not setting execute permissions for bash deploy.sh
remote: Running deployment command...
remote: ENOENT: no such file or directory, open '/opt/nodejs/12.16.3/npm.txt'
remote: Handling node.js deployment.
remote: Kudu sync from: '/home/site/repository' to: '/home/site/wwwroot'
remote: Ignoring: .deployment
remote: Ignoring: deploy.sh
remote: Copying file: 'package.json'
remote: Ignoring: .git
remote: Detecting node version spec...
remote: Using package.json engines.node value: 12.16.3
remote: Node.js versions available on the platform are: 4.4.7, 4.5.0, 4.8.0, 6.2.2, 6.6.0, 6.9.3, 6.10.3, 6.11.0, 6.17.1, 8.0.0, 8.1.4, 8.2.1, 8.8.1, 8.9.4, 8.11.2, 8.12.0, 8.15.1, 8.17.0, 9.4.0, 10.1.0, 10.10.0, 10.14.2, 10.16.3, 10.19.0, 12.16.3, 14.0.0.
remote: Resolved to version 12.16.3
remote: Detecting npm version spec...
remote: An error has occurred during web site deployment.
remote: select node version failed

Here's what baffles me. from the logs

1. Ignoring scriipt

remote: Ignoring: .deployment
remote: Ignoring: deploy.sh

I read somewhere that this may happen if i edited the file. I deleted what i typed and regenerated it. Still I get this issue

 

2. Node version remote: Using package.json engines.node value: 12.16.3

remote: Resolved to version 12.16.3

remote: Detecting npm version spec...

remote: An error has occurred during web site deployment.

remote: select node version failed

 

Why did it fail? I am at a loss. I don't know how to proceed.

1 Reply

@jijodevsame problem here, I still looking for a solution, there's also an issue opened two years ago on kudu on github, and there's no answer. I think the best thing to do is to moving away from azure app service and using something more reliable.

https://github.com/projectkudu/kudu/issues/2870#issuecomment-443464291