Closed ghost closed 4 months ago
Could you share a small repo that demonstrates this error? Thanks!
https://github.com/jmb-mage/KuduRepo there is the repo.
I think the problem is the Kudu npm install
runs in prod mode, and therefore does not install the devDependencies? Is there some way to change deploy.sh
so that it install the devDependencies before Kudu runs npm install
?
Looks like your repo is using its own custom deployment script (here). So you should be able to change it to do whatever you want.
How would I change the deploy.sh
script to install the devDependencies
from package.json before it runs npm install
?
Sorry, my knowledge of Unix scripts and Kudu isn't enough.
@davidebbo I'm trying to run npm insall
, but it shows Error: Method Not Allowed
. Please check the following log:
npm install
npm ERR! Error: Method Not Allowed
npm ERR! at errorResponse (D:\Program Files (x86)\npm\1.4.28\node_modules\npm\lib\cache\add-named.js:260:10)
npm run build -- --output-path "D:\home\site\repository\dist"
npm ERR! at D:\Program Files (x86)\npm\1.4.28\node_modules\npm\lib\cache\add-named.js:203:12
npm ERR! at saved (D:\Program Files (x86)\npm\1.4.28\node_modules\npm\node_modules\npm-registry-client\lib\get.js:167:7)
npm ERR! at Object.oncomplete (fs.js:108:15)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "node" "D:\\Program Files (x86)\\npm\\1.4.28\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd D:\home\site\repository
npm ERR! node -v v0.10.40
How to debug this Custom Deployment Script?
It seems the Node.js version is really outdated.
Node.js Version
v0.10.40
I changed my appsettings using the following script fixed all my problem.
az webapp config appsettings set --name <app-name> --resource-group <resource-group-name> --settings WEBSITE_NODE_DEFAULT_VERSION="~16"
All the details here: https://github.com/projectkudu/kudu/wiki/Custom-Deployment-Script
@doggy8088 this is a very old issue, and I haven't been involved in Kudu is many years. I suggest opening a new issue to give it more attention.
@davidebbo I already figured it out and solved. Thanks! :)
@doggy8088 Great!
Hi
If the problem persists and is related to running it on Azure App Service, please open a support incident in Azure: https://learn.microsoft.com/en-us/azure/azure-portal/supportability/how-to-create-azure-support-request
This way we can better track and assist you on this case
Thanks,
Joaquin Vano Azure App Service
Before I deploy to Kudu I run this command to create
.deployment
anddeploy.sh
.azure site deploymentscript --node
But then the problem is getting Kudu to install the
devDependencies
, specificallyng
fromangular-cli
. Here is packages.json from angular-cli, with an addition of"engines"
line at the end for Kudu. The problem is"start": "ng serve",
or what it should really be for a Kudu deploymentng build
, but it can't findng
at all.Error is:
Start script "ng serve" from package.json is not found.
What am I missing?