coreybutler / node-windows

Windows support for Node.JS scripts (daemons, eventlog, UAC, etc).
Other
2.79k stars 358 forks source link

Doesn't work at all #223

Closed ayami123 closed 4 years ago

ayami123 commented 5 years ago

var Service = require('node-windows').Service;

// Create a new service object var svc = new Service({ name:'test', description: 'test', script: 'E:\test\test.js', nodeOptions: [ '--harmony', '--max_old_space_size=4096' ] });

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

svc.install();

after running this nothing shows up? in the Service.msc

coreybutler commented 5 years ago

You may need E:\\test\\test.js, otherwise JavaScript may be escaping your path (i.e. it thinks of it as E:testtest.js). Also check the wiki for troubleshooting on common issues.