简体   繁体   English

使用iisnode在Azure Web App上运行AtlasBoard

[英]Running AtlasBoard on Azure Web App with iisnode

I´m trying to run AtlasBoard in an Azure Web App, but can´t get it to work. 我正在尝试在Azure Web应用程序中运行AtlasBoard,但无法使其正常工作。 I have created a new board using the "Get started in 30 seconds" steps and the demo board runs fine when I start it locally. 我使用“ 30秒内入门”步骤创建了一个新板,并且在本地启动演示板时,演示板运行良好。 It works both by starting it with atlasboard start 3333 or if I run node start . 它既可以通过使用atlasboard start 3333启动它来运行,也可以通过运行node start运行。

I´ve added the node_modules directory to .gitignore. 我已经将node_modules目录添加到.gitignore。

I´m using git deployment on Azure and this seems to work fine. 我在Azure上使用git部署,这似乎工作正常。 The deployment log also shows that the npm modules are installed. 部署日志还显示已安装npm模块。

This is the last ouput from the deployment: 这是部署的最后一个输出:

Using start-up script start.js from package.json.
Generated web.config.
The iisnode.yml file explicitly sets nodeProcessCommandLine. Automatic node.js version selection is turned off.
Selected npm version 3.5.1
npm WARN Invalid name: "HRMTS AtlasBoard"
npm WARN wwwroot No description
npm WARN wwwroot No repository field.
npm WARN wwwroot No README data
npm WARN wwwroot No license field.
Finished successfully.

However, the app doesn´t seem to start and when I look at the log message in the Kudu console, I get this: 但是,该应用程序似乎无法启动,当我在Kudu控制台中查看日志消息时,得到以下信息:

Error: error installing D:\home\site\wwwroot\packages\demo
    at process.<anonymous> (D:\Program Files (x86)\iisnode\interceptor.js:73:106)
    at emitOne (events.js:96:13)
    at process.emit (events.js:188:7)
    at process._fatalException (node.js:267:26)

Does anyone have a clue about what´s wrong here? 有人知道这里出什么问题了吗?

If you are using the repo of the demo application at https://bitbucket.org/atlassian/atlasboard/src to test on Azure, there several additional modifications we need do to make the test run on Azure Web Apps. 如果您使用位于https://bitbucket.org/atlassian/atlasboard/src的演示应用程序的存储库在Azure上进行测试,则需要做一些其他修改才能使测试在Azure Web Apps上运行。

First of all, assume you have successfully deploy the application to Azure, and it failed when start running the application. 首先,假设您已成功将应用程序部署到Azure,并且在开始运行该应用程序时失败。 Then you can leverage Kudu console site or Visual Studio Online extension (refer to the answer of How to install composer on app service? for how to enable extensions of Azure Web Apps) to check the error log at D:\\home\\site\\wwwroot\\packages\\demo\\npm-debug.log . 然后,您可以利用Kudu控制台站点或Visual Studio Online扩展(有关如何启用Azure Web Apps的扩展,请参阅“ 如何在应用程序服务上安装作曲家?”的答案)来检查D:\\home\\site\\wwwroot\\packages\\demo\\npm-debug.log的错误日志D:\\home\\site\\wwwroot\\packages\\demo\\npm-debug.log

There are similar errors: 有类似的错误:

155 error node -v v0.6.20 155错误节点-v v0.6.20

156 error npm -v 1.1.37 156错误npm -v 1.1.37

157 error message SSL Error: CERT_UNTRUSTED 157错误消息SSL错误:CERT_UNTRUSTED

It seems that the atlasboard runs command with very low node version on Azure. 看起来atlasboard在Azure上以非常低的节点版本运行命令。 We can manually modify the dependent scripts to bypass the errors. 我们可以手动修改从属脚本来绕过错误。

If you get error during deployment, you should modify the npm version in package.json before deployment, for example: 如果在部署过程中出错,则应在部署之前修改package.json的npm版本,例如:

"engines": {
    "npm": ">2.0.0",
    "node": ">=0.10"
  },

After deployment: 部署后:

  • check and modify the port in the start.js in the root directory: 检查并修改根目录下start.js中的port

     atlasboard({port: process.env.port||3000 , install: true}, function (err) { if (err) { throw err; } }); 
  • modify the install function in D:\\home\\site\\wwwroot\\node_modules\\atlasboard\\lib\\package-dependency-manager.js to use a higher npm version and remove --production param, eg : 修改D:\\home\\site\\wwwroot\\node_modules\\atlasboard\\lib\\package-dependency-manager.jsinstall功能以使用更高的npm版本并删除--production参数,例如:

     ... var npmCommand = isWindows ? "D:\\\\Program Files (x86)\\\\npm\\\\3.5.1\\\\npm.cmd" : "npm"; executeCommand(npmCommand, ["install", pathPackageJson], function(err, code){ ... }) 

Then restart your website. 然后重新启动您的网站。

Any further concern, please feel free to let me know. 如有任何其他疑问,请随时告诉我。

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

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