简体   繁体   English

在节点 JS 中构建 Azure web 应用程序时出现权限被拒绝错误

[英]Permission Denied error while building Azure web app in node JS

I am trying to do a manual build of an Azure web app that is running on a Windows instance using Node JS and Express.我正在尝试使用 Node JS 和 Express 手动构建在 Windows 实例上运行的 Azure web 应用程序。 I am getting this error message when I run npm run start;我在运行 npm run start 时收到此错误消息;

node:events:505
  throw er; // Unhandled 'error' event
  ^

Error: listen EACCES: permission denied :::4000
at Server.setupListenHandle [as _listen2] (node:net:1372:16)
at listenInCluster (node:net:1420:12)
at Server.listen (node:net:1508:7)
at Function.listen (C:\home\site\wwwroot\node_modules\express\lib\application.js:618:24)
at Object.<anonymous> (C:\home\site\wwwroot\index.js:39:5)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47
Emitted 'error' event on Server instance at:
at emitErrorNT (node:net:1399:8)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  code: 'EACCES',
errno: -4092,syscall: 'listen',
address: '::',
port: 4000

I have tried changing the port number, carefully checked the index.js, carefully checked the package.json, rerun npm install, and am still getting the same error.我试过更改端口号,仔细检查了index.js,仔细检查了package.json,重新运行npm安装,仍然出现同样的错误。 Any ideas would be greatly appreciated!!任何想法将不胜感激!

  • Most probably this issue is because of lack of a web.config file in the folder.这个问题很可能是因为文件夹中缺少web.config文件。

  • Now instead of creating web.config on our own If we deploy the code using git it will create the file for us.现在不是我们自己创建web.config如果我们使用 git 部署代码,它将为我们创建文件。

  • In azure there are multiple option such as azure GitHub action, azure repo and bitbucket etc.在 azure 中有多个选项,例如 azure GitHub action,azure repo 和 bitbucket 等。

Here I have deployed using local git and I am deploying an express app.在这里,我使用本地 git 进行了部署,并且正在部署一个快速应用程序。

在此处输入图像描述

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM