运行节点应用程序似乎存在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
重现的步骤:
engines
(截至本文时默认为4.2.3)engines
字段更改为6.2.2
或6.3.0
- >失败。仅供参考,6.0.0
答案 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以下的版本。