Reputation: 5637
I'm occasionally getting "Bad Request" in the Azure Console (located in the main 'blade' of the Azure web app). One example is when running npm install grunt-sass
but there were several other times with different commands, all of which are valid commands that should execute immediately with no errors.
I think this is a bug in Azure. I haven't seen the problem when using the Kudu Diagnostic Console.
Why is this happening?
Upvotes: 0
Views: 1271
Reputation:
I found that if you're having a "Bad Request"
error while running the npm install
command in Azure App Service's Console, the npm
process is still running in the background and it will complete.
That means that you should not try to run npm i
again until it completes. You can monitor the progress via FTP - when the .staging
folder in node_modules
is empty, that means installation is complete.
Upvotes: 1
Reputation: 13918
On my side, it looks like depends on the npm version in the Azure Web Apps sanbox. I upgrade the npm version to 4.2.0
, and successfully installed grunt-sass
both via Kudu Conosole, or App Service Editor's Console Tool.
Please navigate to Application settings blade of your Azure Web Apps, and add the WEBSITE_NPM_DEFAULT_VERSION
configuration in App settings section:
Then, it should work as expected.
At last, we recommend you can leverage custom deployment of Azure Web Apps, you can configure your dependencies in package.json
, and deploy to Azure via Git, the deployment task will install the dependencies automatically, you can refer to Custom startup command for Node.js app on Azure with Babel 6 for the similar steps.
Upvotes: 1