IISNode似乎无法在IIS中运行

时间:2017-04-27 23:31:31

标签: node.js angular iis iisnode

我正在尝试在IIS中托管我的Node.js.我在Angular2中构建了一个应用程序。现在,我能够托管项目并在安装了IISnode的IIS中运行它。

这是我的web.config文件。

<configuration>
    <system.webServer>
        <handlers>
            <add name="iisnode" path="src/app/app.component.ts" verb="*" modules="iisnode" />
        </handlers>
        <rewrite>
            <rules>
                <rule name="myapp">
                    <match url="(.*)" />
                    <action type="Rewrite" url="src/app/app.component.ts" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

这是我将NODE托管到IIS时所遵循的步骤: https://www.upnxt.com/blog/deploying-node-on-iis

但是当我运行应用程序时,我收到了这个错误:

Application has thrown an uncaught exception and is terminated:
C:\src\Angular2\BuyPracticeTest_AV4\src\app\app.component.ts:2
import { Service } from './app.service';
^^^^^^
SyntaxError: Unexpected token import

似乎 import 语句未被识别为关键字。或者我真的不知道。

顺便说一下,我对这件事情不熟悉。

0 个答案:

没有答案
相关问题