在Azure的Web站点节点0.11.x [英] Node 0.11.x in Azure Web Site

查看:204
本文介绍了在Azure的Web站点节点0.11.x的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获得与节点的0.11.x版本在Azure上运行一个应用程序的节点,这样我就可以采取一些新功能(例如发电机和放大器;兴亚)。

I am trying to get a node app running on Azure with version 0.11.x of node, so I can take advantage of some new features (e.g. generators & Koa).

我已经阅读了这个问题,并试图按照步骤,没有成功至今:

I have read this question and tried to follow the steps, with no success so far:

<一个href=\"http://stackoverflow.com/questions/25194947/error-setting-up-node-v0-11-x-on-azure-website\">Error在Azure网站设置节点v0.11.x

Error setting up node v0.11.x on Azure WebSite

下面是我做的步骤:


  1. 在VS2013(UPDATE3),文件=>新建项目选择空白微软
    Azure的Node.js的Web应用程序(在模板/使用Javascript /的node.js)
    单击确定

  1. In VS2013 (update3), File => New Project Choose "Blank Microsoft Azure Node.js Web Application" (under Templates/Javascript/node.js), click OK

在server.js,改变过去的Hello World的线来表示该节点
版本:

In server.js, change the last "hello world" line to show the node version:

res.end('应用在节点版本运行'+ process.version +的'\\ n');

添加一个新的文件iisnode.yml在同一文件夹中server.js,与内容:

Add a new file "iisnode.yml" in same folder as server.js, with the contents:

nodeProcessCommandLine:D:\\家\\网站\\ wwwroot的\\ BIN \\ node.exe

复制node.exe(0.11.13版)进入bin文件夹(其中server.js的文件夹下)

Copy node.exe (version 0.11.13) into the "bin" folder (under the folder where server.js is)

右键单击该项目在VS中,选择发布,创建新网站与所有默认凭据的/ etc ...然后单击发布

Right-click the project in VS, select Publish, create new Website with all the default credentials/etc... then click Publish

目前这一点上,myproj.azurewebsites.net页出现的响应:

At this point, the "myproj.azurewebsites.net" page comes up with the response:

App running in node version v0.10.29

但我希望的节点版本0.11.13。如果我去我的\\ bin文件夹,然后运行 node.exe --version 它吐出:

v0.11.13

本地运行(F5)似乎做正确的事:应用在节点版v0.11.13运行

我还算难倒如何让节点0.11上的Azure网站上运行,有什么建​​议?

I'm fairly stumped how to get node 0.11 running on an Azure web site, any suggestions?

推荐答案

好吧,我找到了一个解决方法的问题,希望这样可以节省别人的一段时间。

Well I found a workaround to the problem, hopefully this saves someone else some time.

它看起来像问题是,IISNODE.YML文件需要ANSI EN codeD。当我创建从Visual Studio 2013的文件,它选择了UTF8作为该文件的默认编码。

It looks like the problem is that the IISNODE.YML file needs to be ANSI encoded. When I created the file from Visual Studio 2013, it chose UTF8 as the default encoding for the file.

要解决此问题,保存与ANSI编码的文件。对于eample,您可以通过打开为此在记事本文件,然后做另存为...并挑选编码为ANSI。

To correct the problem, save the file with ANSI encoding. For eample, you can do this by open the file in notepad, then doing Save As... and pick the Encoding as ANSI.

我简单看了一下源$ C ​​$ C为iisnode,看来,这个问题是在这个code:

I looked briefly at the source code for "iisnode" and it appears that the problem is in this code:

CModuleConfiguration::ApplyYamlConfigOverrides

虽然我没有时间来测试它。

although I didn't have time to test it yet.

这篇关于在Azure的Web站点节点0.11.x的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆