Node.js可以';是否无法访问我的Windows用户配置文件中的文件?
我在Windows上运行IIS 10,并使用httpplatformhandler作为反向代理 httpplatformhandler的Node.js可以';是否无法访问我的Windows用户配置文件中的文件?,node.js,reverse-proxy,fs,iis-10,httpplatformhandler,Node.js,Reverse Proxy,Fs,Iis 10,Httpplatformhandler,我在Windows上运行IIS 10,并使用httpplatformhandler作为反向代理 httpplatformhandler的web.config调用node.js,这意味着用户\IIS\u IUSRS如果希望修改任何内容,应该能够写入目录,我相信(可能是错误的)这就是node.js进程的开始;因此,我在node.js要写入的目录中为\IIS\u IUSRS授予了完全权限 但是,当我尝试运行node.js web应用程序时,它会卡在C:\Users\meUserName中,无法继续运行
web.config
调用node.js,这意味着用户\IIS\u IUSRS
如果希望修改任何内容,应该能够写入目录,我相信(可能是错误的)这就是node.js进程的开始;因此,我在node.js要写入的目录中为\IIS\u IUSRS
授予了完全权限
但是,当我尝试运行node.js web应用程序时,它会卡在C:\Users\meUserName
中,无法继续运行C:\Users\meUserName\ONEDRIVE-CompanyName\meApp
有没有办法解决这个问题,让它正常工作?如果能用OneDrive传输目录就好了
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<add
name="httpplatformhandler"
path="*"
verb="*"
modules="httpPlatformHandler"
resourceType="Unspecified"
requireAccess="Script" />
</handlers>
<httpPlatform
stdoutLogEnabled="true"
stdoutLogFile=".\node.log"
startupTimeLimit="20"
processPath="C:\Program Files\nodejs\node.exe"
arguments=".\node_modules\test\test.js ./wiki --listen port=PORT path-prefix=/MyApp"
>
<environmentVariables>
<environmentVariable name="PORT" value="%HTTP_PLATFORM_PORT%" />
<environmentVariable name="NODE_ENV" value="Production" />
</environmentVariables>
</httpPlatform>
</system.webServer>
</configuration>
v10.15.3每个IIS应用程序池都有一个标识,您必须对web应用程序所需的文件夹/文件授予该标识权限。此外,在Windows上,人们很少将web内容放在用户的文件夹中(通常仅针对该用户)。也不要使用OneDrive文件夹,因为这些文件夹也是冲突和权限问题的来源。
fs.js:114
throw err;
^
Error: EPERM: operation not permitted, lstat 'C:\Users\meUserName'
at Object.realpathSync (fs.js:1456:7)
at toRealPath (internal/modules/cjs/loader.js:203:13)
at Function.Module._findPath (internal/modules/cjs/loader.js:269:22)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:579:25)
at Function.Module._load (internal/modules/cjs/loader.js:508:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)