在Win Server 2012的iisNode上启动小节点应用失败,并显示以下信息:
Application has thrown an uncaught exception and is terminated: Error: EPERM: operation not permitted, lstat 'C:\DATA\WEBFOLDERS' at Object.realpathSync (fs.js:1657:15) at toRealPath (module.js:164:13) at Function.Module._findPath (module.js:213:22) at Function.Module._resolveFilename (module.js:546:25) at Function.Module._load (module.js:475:25) at Module.require (module.js:597:17) at require (internal/module.js:11:18) at Object. (C:\Program Files\iisnode\interceptor.js:211:1) at Module._compile (module.js:653:30) at Object.Module._extensions..js (module.js:664:10)
此文件已记录到文件夹'webfolders'/'sitefolder'/ iisnode上的文件中
站点文件夹及其所有子文件夹具有(同时)“所有人”,具有所有访问权限。 但是,当然,父文件夹“ webfolders”不会,并且网站代码也绝不能访问它。
已降级为节点版本8.12.0。因为我们知道它可以在测试服务器(以及IIS 8)上正常运行该应用程序
web.config是:
<system.webServer>
<handlers>
<add name="iisnode" path="nodeapp.js" verb="*" modules="iisnode" />
</handlers>
<rewrite>
<rules>
<rule name="default">
<match url="^$" />
<action type="Rewrite" url="nodeapp.js" />
</rule>
<rule name="validate">
<match url="validate/*" />
<action type="Rewrite" url="nodeapp.js/validate" />
</rule>
</rules>
</rewrite>
<security>
<requestFiltering>
<hiddenSegments>
<add segment="node_modules" />
<add segment="Scripts" />
<add segment="iisnode" />
</hiddenSegments>
</requestFiltering>
</security>
<iisnode nodeProcessCommandLine="%programfiles%\nodejs\node.exe" devErrorsEnabled="true" debuggingEnabled="true" />
</system.webServer>