Reputation: 503
I want to deploy a app web service in azure but the problem I got is if I add to dependecies the microsoft graph api, when I update the git and proced to deploy then the server returns "Error: Method Not Allowed".
Here is the app github(its a simple helloWorld app I was using to test): https://github.com/ricardoGuerreroAvantica/test_azure_helloworld
here is the error log I got on the deploy:
Command: "D:\home\site\deployments\tools\deploy.cmd".
Handling node.js deployment.
Creating app_offline.htm
KuduSync.NET from: 'D:\home\site\repository' to: 'D:\home\site\wwwroot'
Copying file: 'package-lock.json'
Copying file: 'package.json'
Deleting app_offline.htm
Looking for app.js/server.js under site root.
Using start-up script app.js
Generated web.config.
The package.json file does not specify node.js engine version constraints.
The node.js application will run with the default node.js version 0.10.40.
Selected npm version 1.4.28
npm WARN package.json [email protected] No README data
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] punycode is also the name of a node core module.
npm WARN package.json [email protected] path is also the name of a node core module.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] util is also the name of a node core module.
npm WARN package.json [email protected] string_decoder is also the name of a node core module.
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 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)
Failed exitCode=1, command="D:\Program Files (x86)\nodejs\0.10.40\node.exe" "D:\Program Files (x86)\npm\1.4.28\node_modules\npm\bin\npm-cli.js" install --production
npm ERR! at Object.oncomplete (fs.js:108:15)
An error has occurred during web site deployment.
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 "D:\\Program Files (x86)\\nodejs\\0.10.40\\node.exe" "D:\\Program Files (x86)\\npm\\1.4.28\\node_modules\\npm\\bin\\npm-cli.js" "install" "--production"
npm ERR! cwd D:\home\site\wwwroot
npm ERR! node -v v0.10.40
npm ERR! npm -v 1.4.28
npm ERR! code E405
npm WARN package.json [email protected] No README data\r\nnpm WARN package.json [email protected] No repository field.\r\nnpm WARN package.json [email protected] punycode is also the name of a node core module.\r\nnpm WARN package.json [email protected] path is also the name of a node core module.\r\nnpm WARN package.json [email protected] No repository field.\r\nnpm WARN package.json [email protected] util is also the name of a node core module.\r\nnpm WARN package.json [email protected] string_decoder is also the name of a node core module.\r\nnpm ERR! Error: Method Not Allowed\r\nnpm ERR! at errorResponse (D:\Program Files (x86)\npm\1.4.28\node_modules\npm\lib\cache\add-named.js:260:10)\r\nnpm ERR! at D:\Program Files (x86)\npm\1.4.28\node_modules\npm\lib\cache\add-named.js:203:12\r\nnpm ERR! at saved (D:\Program Files (x86)\npm\1.4.28\node_modules\npm\node_modules\npm-registry-client\lib\get.js:167:7)\r\nnpm ERR! at Object.oncomplete (fs.js:108:15)\r\nnpm ERR! If you need help, you may report this *entire* log,\r\nnpm ERR! including the npm and node versions, at:\r\nnpm ERR! <http://github.com/npm/npm/issues>\r\n\r\nnpm ERR! System Windows_NT 6.2.9200\r\nnpm ERR! command "D:\\Program Files (x86)\\nodejs\\0.10.40\\node.exe" "D:\\Program Files (x86)\\npm\\1.4.28\\node_modules\\npm\\bin\\npm-cli.js" "install" "--production"\r\nnpm ERR! cwd D:\home\site\wwwroot\r\nnpm ERR! node -v v0.10.40\r\nnpm ERR! npm -v 1.4.28\r\nnpm ERR! code E405\r\nD:\Program Files (x86)\SiteExtensions\Kudu\79.11121.3655\bin\Scripts\starter.cmd "D:\home\site\deployments\tools\deploy.cmd"
Upvotes: 2
Views: 1242
Reputation: 24148
According to your error information, you were deploying the app on the default node.js version 0.10.40
of Azure WebApps which caused your issue, because the msgraph-sdk-javascript
package depended by your app requires NodeJS higher version.
As the GitHub Repo README.md
said, it has been tested with v6.9.1
, so you can upgrade the Node version of your Azure WebApp via add a record WEBSITE_NODE_DEFAULT_VERSION
with 6.9.1
in the Application settings
on Azure portal like the figure below which comes from my answer for a similar SO thread Kudu npm install failed that you can also refer to.
Upvotes: 7