Topic on Project talk:Support desk/Archive

How to get Parsoid always running on Windows Server 2012 so ViaualEditor Works

8
AdamLacey (talkcontribs)

Hi, I'm really struggling getting Parsoid running on Windows Server 2012 R2 ans stay running when I close the command prompt window

I can Get Visual Editor working when I run in CMD (or PowerShell):

CD C:\Users\%UserName%\node_modules\parsoid

node bin\server.js ("node bin\server.js &" or "node bin\server.js > stdout.txt 2> stderr.txt &")

Visual Editor runs when I leave this window open, however as soon as I close it, log off or anything that terminates it, Visual Editor stops working.

How am I able to run this command and keep it working and not have it rely on my profile also?

AdamLacey (talkcontribs)

I have copied "C:\Users\%UserName%\node_modules" to the Root of the C:\ and it works running it from there so it's no longer profile reliant. However I still can't get it to run without closing a the window.

I have setup a windows domain account that doesn't have desktop access so it can run scheduled tasks if required but I am not successfully got it running allowing wiki to work, or without flooding the task manager with loads of node.exe's, so I'm still stuck on the always running part

MarkAHershberger (talkcontribs)
AdamLacey (talkcontribs)

Thanks, this isn't working for me? I did the parts:

The recommended way to install node-windows is with npm, using the global flag:

npm install -g node-windows

Then, in your project root, run:

npm link node-windows

Then ran the .vbs file with the code in it (with my edits and as it is to make sure typo's etc):

var Service = require('node-windows').Service;
// Create a new service object
var svc = new Service({

    name:'Hello World',
    description: 'The nodejs.org example web server.',
    script: 'C:\\path\\to\\helloworld.js'

});

// Listen for the "install" event, which indicates the
// process is available as a service.
svc.on('install',function(){
    svc.start();
});

svc.install();

My Edits:

var Service = require('node-windows').Service;
// Create a new service object
var svc = new Service({

    name:'WikiMedia Parsoid Service',
    description: 'The nodejs.org example web server.',
    script: 'C:\\node_modules\\parsoid\\bin\\server.js'

});

// Listen for the "install" event, which indicates the
// process is available as a service.
svc.on('install',function(){
    svc.start();
});

svc.install();

But I get the error each time:

---------------------------
Windows Script Host
---------------------------
Script:    C:\Users\alacey\Desktop\TEST.vbs
Line:    1
Char:    23
Error:    Syntax error
Code:    800A03EA
Source:     Microsoft VBScript compilation error
---------------------------
OK   
---------------------------

Am I missing something obvious here?

Kind regards

Adam

MarkAHershberger (talkcontribs)

It says it is erroring out on character 23 of line 1. Make sure you aren't using smartquotes there and that it is just a regular, ascii apostrophe.

Also, make sure you have node-windows installed.

Let me know if neither of those fixed it.

AdamLacey (talkcontribs)

I've retyped the characters in case copy and paste did anything and made sure node-windows by running it again in the I said above was installed with the results below,

npm install -g node-windows

+ node-windows@0.1.14

added 5 packages in 1.433s

but it still doesn't work and returns the same error message

MarkAHershberger (talkcontribs)

Try the other answers from the link I gave above. One of them should work. Unfortunately, I don't have any experience with node.js running as a service under windows.

AdamLacey (talkcontribs)

No worries, thanks for your assistance so far @MarkAHershberger, I will use the Task Scheduler on start up to run the node.exe, it runs the node.exe averagely that 34 times but not loads more it seems, so they will do as it is working.

Many thanks

Reply to "How to get Parsoid always running on Windows Server 2012 so ViaualEditor Works"