[W10] Does anybody got problem with exec with NSSM?

I have been trying to run exec command but it does not work if I start node-red with NSSM on W10.
However, it works if I start node-red manually.

What account is nssm using?

My guess is system account.

My second guess is your mom global directory is set for something like c:\users\youname\blahblah

My third guess is the path variable for node & this node-red with is set up in user environment variables - meaning when system tries to run node-red it has no idea where node or node-red are.

Look in those areas.

I install nssm from chocolatey;

choco install nssm

My user is administrator.

I run both node-red manually from elevated and non-elevated powershell/cmd
exec runs fine

so you didnt answer my questions about what account NSSM is using

  • NSSM runs your application as windows service.
  • When it executes your application (node-red) it uses a windows account - If you dont specify an account in NSSM settings, it will probably use the "system" account (not yours, not administrator etc)
  • As your install of node-red is likely in c:\users\youname\blahblah and your PATH environment variable is set for USER (not for system) - the system account cannot find node-red.

Does any of the above make any sense?

EDIT...
run node-red and copy the text you see in the cmd window between 3 backticks
e.g...

```
paste node-red startup text from cmd window here
```

28 Mar 20:08:59 - [info]

Welcome to Node-RED

28 Mar 20:08:59 - [info] Node-RED version: v1.0.3
28 Mar 20:08:59 - [info] Node.js version: v12.16.1
28 Mar 20:08:59 - [info] Windows_NT 10.0.18362 x64 LE
28 Mar 20:08:59 - [info] Loading palette nodes
28 Mar 20:09:01 - [info] Worldmap version 2.3.2
28 Mar 20:09:01 - [info] Dashboard version 2.19.4 started at /ui
(node:20468) [DEP0016] DeprecationWarning: 'GLOBAL' is deprecated, use 'global'
28 Mar 20:09:01 - [info] Settings file : \Users\SP3.node-red\settings.js
28 Mar 20:09:01 - [info] Context store : 'default' [module=memory]
28 Mar 20:09:01 - [info] User directory : \Users\SP3.node-red
28 Mar 20:09:01 - [warn] Projects disabled : editorTheme.projects.enabled=false
28 Mar 20:09:01 - [info] Flows file : \Users\SP3.node-red\flows_DESKTOP-V1QPP0J.json
28 Mar 20:09:01 - [info] Server now running at http://127.0.0.1:1880/
28 Mar 20:09:01 - [warn]

Ah sorry, I see what you mean now.
I just changed the local account to my account.

Will update if it works.

After changing the account with

nssm edit Node-red

and go to log-on and input my credentials

still not working

What account did you enter in nssm ? Was it SP3.node-red?

Because that's what account you seem to be using

Also, you might need to look into permitting that account to "Log on as a service"

Have you looked in Windows event log - it will highlight these kind of issues

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.