我尝试使用 NSSM 服务编辑器 GUI 设置 nssm 服务来启动 node-js 模块。这对命令本身来说工作得很好,node-js 启动得很好。问题是当我尝试在 i/o 选项卡上将输出重定向到日志文件时,将输出 (stdout) 和错误 (stderr) 设置为 D:\qewd-up\Log\Log.txt 出现日志文件那里,但似乎充满了奇怪的字符(如中文),而不是如果 stdout 被单独放置并且 node-js 从那里启动,则显示在终端上的实际 ASCII 文本输出。这样做的正确方法是什么?谢谢!
版本:2.24.0.74 配置:
PS C:\Program Files\nodejs> nssm get QEWD-UP Application
c:\Program Files\nodejs\node.exe
PS C:\Program Files\nodejs> nssm get QEWD-UP AppParameters
node_modules/qewd/up/run_native.js
PS C:\Program Files\nodejs> nssm get QEWD-UP AppDirectory
d:\qewd-up
PS C:\Program Files\nodejs> nssm get QEWD-UP AppExit
Parameter "AppExit" requires a subparameter!
PS C:\Program Files\nodejs> nssm get QEWD-UP AppAffinity
All
PS C:\Program Files\nodejs> nssm get QEWD-UP AppEnvironment
PS C:\Program Files\nodejs> nssm get QEWD-UP AppEnvironmentExtra
PS C:\Program Files\nodejs> nssm get QEWD-UP AppNoConsole
1
PS C:\Program Files\nodejs> nssm get QEWD-UP AppPriority
NORMAL_PRIORITY_CLASS
PS C:\Program Files\nodejs> nssm get QEWD-UP AppRestartDelay
0
PS C:\Program Files\nodejs> nssm get QEWD-UP AppStdin
PS C:\Program Files\nodejs> nssm get QEWD-UP AppStdinShareMode
2
PS C:\Program Files\nodejs> nssm get QEWD-UP AppStdinCreationDisposition
3
PS C:\Program Files\nodejs> nssm get QEWD-UP AppStdinFlagsAndAttributes
128
PS C:\Program Files\nodejs> nssm get QEWD-UP AppStdout
PS C:\Program Files\nodejs> nssm get QEWD-UP AppStdoutShareMode
3
PS C:\Program Files\nodejs> nssm get QEWD-UP AppStdoutCreationDisposition
4
PS C:\Program Files\nodejs> nssm get QEWD-UP AppStdoutFlagsAndAttributes
128
PS C:\Program Files\nodejs> nssm get QEWD-UP AppStderr
PS C:\Program Files\nodejs> nssm get QEWD-UP AppStderrShareMode
3
PS C:\Program Files\nodejs> nssm get QEWD-UP AppStderrCreationDisposition
4
PS C:\Program Files\nodejs> nssm get QEWD-UP AppStderrFlagsAndAttributes
128
PS C:\Program Files\nodejs> nssm get QEWD-UP AppStopMethodSkip
0
PS C:\Program Files\nodejs> nssm get QEWD-UP AppStopMethodConsole
1500
PS C:\Program Files\nodejs> nssm get QEWD-UP AppStopMethodWindow
1500
PS C:\Program Files\nodejs> nssm get QEWD-UP AppStopMethodThreads
1500
PS C:\Program Files\nodejs> nssm get QEWD-UP AppThrottle
1500
PS C:\Program Files\nodejs> nssm get QEWD-UP AppRotateFiles
0
PS C:\Program Files\nodejs> nssm get QEWD-UP AppRotateOnline
0
PS C:\Program Files\nodejs> nssm get QEWD-UP AppRotateSeconds
0
PS C:\Program Files\nodejs> nssm get QEWD-UP AppRotateBytes
0
PS C:\Program Files\nodejs> nssm get QEWD-UP AppRotateBytesHigh
0
PS C:\Program Files\nodejs> nssm get QEWD-UP DependOnGroup
PS C:\Program Files\nodejs> nssm get QEWD-UP DependOnService
Cache_d-_cache_smile
PS C:\Program Files\nodejs> nssm get QEWD-UP Description
NodeJS QEWD-UP
PS C:\Program Files\nodejs> nssm get QEWD-UP DisplayName
QEWD-UP Service
PS C:\Program Files\nodejs> nssm get QEWD-UP ImagePath
C:\Program Files\nodejs\nssm.exe
PS C:\Program Files\nodejs> nssm get QEWD-UP ObjectName
LocalSystem
PS C:\Program Files\nodejs> nssm get QEWD-UP Name
QEWD-UP
PS C:\Program Files\nodejs> nssm get QEWD-UP Start
SERVICE_AUTO_START
PS C:\Program Files\nodejs> nssm get QEWD-UP Type
SERVICE_WIN32_OWN_PROCESS