在Azure App Service上运行节点应用程序,引擎大于6.0.0

时间:2016-07-26 02:32:19

标签: node.js azure azure-web-sites azure-web-app-service

运行节点应用程序似乎存在Azure问题,其引擎大于6.0.0。

它出现类似于以下内容的错误:

Error: Not Found
at \\100.72.114.39\volume-10-default\bc07ff16757397422510\c76bdd71a9f84626a73576980337b6ce\site\wwwroot\config\express.js:36:15
at Layer.handle [as handle_request] (\\100.72.114.39\volume-10-default\bc07ff16757397422510\c76bdd71a9f84626a73576980337b6ce\site\wwwroot\node_modules\express\lib\router\layer.js:95:5)
at trim_prefix (\\100.72.114.39\volume-10-default\bc07ff16757397422510\c76bdd71a9f84626a73576980337b6ce\site\wwwroot\node_modules\express\lib\router\index.js:312:13)
at \\100.72.114.39\volume-10-default\bc07ff16757397422510\c76bdd71a9f84626a73576980337b6ce\site\wwwroot\node_modules\express\lib\router\index.js:280:7
at Function.process_params (\\100.72.114.39\volume-10-default\bc07ff16757397422510\c76bdd71a9f84626a73576980337b6ce\site\wwwroot\node_modules\express\lib\router\index.js:330:12)
at next (\\100.72.114.39\volume-10-default\bc07ff16757397422510\c76bdd71a9f84626a73576980337b6ce\site\wwwroot\node_modules\express\lib\router\index.js:271:10)
at methodOverride (\\100.72.114.39\volume-10-default\bc07ff16757397422510\c76bdd71a9f84626a73576980337b6ce\site\wwwroot\node_modules\method-override\index.js:65:14)
at Layer.handle [as handle_request] (\\100.72.114.39\volume-10-default\bc07ff16757397422510\c76bdd71a9f84626a73576980337b6ce\site\wwwroot\node_modules\express\lib\router\layer.js:95:5)
at trim_prefix (\\100.72.114.39\volume-10-default\bc07ff16757397422510\c76bdd71a9f84626a73576980337b6ce\site\wwwroot\node_modules\express\lib\router\index.js:312:13)
at \\100.72.114.39\volume-10-default\bc07ff16757397422510\c76bdd71a9f84626a73576980337b6ce\site\wwwroot\node_modules\express\lib\router\index.js:280:7

重现的步骤:

  1. 关注此tutorial
  2. 网站正常运行,未指定engines(截至本文时默认为4.2.3)
  3. engines字段更改为6.2.26.3.0 - >失败。
  4. 仅供参考,6.0.0

    运行正常

1 个答案:

答案 0 :(得分:2)

在SO Azure and node js __dirname上有一个类似的问题。

https://github.com/nodejs/node/issues/7294相关,当Node.js版本高于6.2.x时,似乎有一个更改改变了挂载网络共享的__dirname行为。

目前,解决方法是将node.js版本降级到Azure Web App中6.2以下的版本。