MeshCentral Service Crashes

Created on 25 Aug 2019  Â·  31Comments  Â·  Source: Ylianst/MeshCentral

I commented about this on another thread but thought I should put it here because this is related to the NPM install method and the other was more about the installer method. I noticed this on an upgrade and also just tried a brand new install of the latest version; the MeshCentral service crashes it appears from the logs that I have to create this folder manually and copy these files in order for the service to stay running.
{ Error: Cannot find module 'C:meshcentralnode_modulesmeshcentralnode_modulesminimist'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at start (C:meshcentralnode_modulesmeshcentralwinservice.js:39:22)
at Object. (C:meshcentralnode_modulesmeshcentralwinservice.js:76:1)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12) code: 'MODULE_NOT_FOUND' }
{ Error: Cannot find module 'C:meshcentralnode_modulesmeshcentralnode_modulesminimist'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at start (C:meshcentralnode_modulesmeshcentralwinservice.js:39:22)
at Object. (C:meshcentralnode_modulesmeshcentralwinservice.js:76:1)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12) code: 'MODULE_NOT_FOUND' }
{ Error: Cannot find module 'C:meshcentralnode_modulesmeshcentralnode_modulesminimist'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at start (C:meshcentralnode_modulesmeshcentralwinservice.js:39:22)
at Object. (C:meshcentralnode_modulesmeshcentralwinservice.js:76:1)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12) code: 'MODULE_NOT_FOUND' }
{ Error: Cannot find module 'C:meshcentralnode_modulesmeshcentralnode_modulesminimist'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at start (C:meshcentralnode_modulesmeshcentralwinservice.js:39:22)
at Object. (C:meshcentralnode_modulesmeshcentralwinservice.js:76:1)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12) code: 'MODULE_NOT_FOUND' }
{ Error: Cannot find module 'C:meshcentralnode_modulesmeshcentralnode_modulesminimist'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at start (C:meshcentralnode_modulesmeshcentralwinservice.js:39:22)
at Object. (C:meshcentralnode_modulesmeshcentralwinservice.js:76:1)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12) code: 'MODULE_NOT_FOUND' }
{ Error: Cannot find module 'C:meshcentralnode_modulesmeshcentralnode_modulesminimist'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at start (C:meshcentralnode_modulesmeshcentralwinservice.js:39:22)
at Object. (C:meshcentralnode_modulesmeshcentralwinservice.js:76:1)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12) code: 'MODULE_NOT_FOUND' }

question

All 31 comments

So, when posting bug reports, please include how to replicate this problem. What OS and OS version are you using? What NPM commands did you type to get this? Did you using the MeshCentral Installer for Windows?

Any information to get me to replicate this issue would be much appreciated. Thanks.

Sorry Ylian, This is running on Windows Server 2012 R2 using NPM as follows:
cd c:meshcentral
npm install meshcentral
cd /node_modules/meshcentral
node meshcentral --install
This happened after upgrading around version 0.3.9 I believe and I have even tried a new install from scratch. If I go back to let's say 0.3.9-f and upgrade from there this issue happens. The upgrade and even the new install seems to go fine but meshserver service just stops. If I manually create the nodemodules folder at this path: c$meshcentralnode_modulesmeshcentral with minimist, node-windows and ws and contents of these folders the service will stay running and everything works as expected. I gathered this idea from looking at the logs "Error: Cannot find module 'C:meshcentralnode_modulesmeshcentralnode_modulesminimist'". Please let me know what else I can provide or test to help. Thanks

Ok, thanks. That is what I needed. Note that you can always rename "node_modules" to another name and do "npm install meshcentral" again, but "npm install" does not install all the modules MeshCentral needs. A workaround may be to run it once manually to let it install the optional modules.

cd c:\meshcentral
npm install meshcentral
node node_modules/meshcentral
(wait, optional modules will install, hit ctrl-c when done)
node node_modules/meshcentral --install

Ok, so I had a chance to try this and ran all of the above commands as you recommended. This is the first part:
c:meshcentral>npm install meshcentral
npm WARN meshcentral No description
npm WARN meshcentral No repository field.
npm WARN meshcentral No license field.

  • [email protected]
    updated 1 package and audited 530 packages in 13.428s
    found 0 vulnerabilities

c:meshcentral>node node_modules/meshcentral
MeshCentral HTTP redirection server running on port 80.
MeshCentral v0.4.0-k, Hybrid (LAN + WAN) mode.
MeshCentral Intel(R) AMT server running on support.rsa-systems.org:4433.
Server _customer1 has no users, next new account will be site administrator.
Server info has no users, next new account will be site administrator.
MeshCentral HTTPS server running on support.rsa-systems.org:443.
SMTP mail server mail.rsa-systems.org working as expected.

Then when I run the last part:
c:meshcentral>node node_modules/meshcentral --install
MeshCentral service installed.
MeshCentral service started.

The service is there but it still stops continually. Should there be a folder named "node_modules" under this path? C:meshcentralnode_modulesmeshcentral
When I create it manually everything works but it gets deleted when I update again.

Ylianst, have you had a chance to look at this based on me trying your suggestion (node node_modules/meshcentral) and still the same result after each update to meshcentral where the nodemodules folder has to be recreated?

Ylianst, I was just checking to see if this issue was resolved and I just missed it. I am still having this issue when I update meshcentral and the node_modules folder gets removed which causes the meshcentral server service to stop. I have the following folder structure: C:meshcentralnode_modulesmeshcentral (node_modules folder gets deleted from here) and I am running these commands:
cd c:meshcentral
npm install meshcentral
node node_modules/meshcentral
(wait, optional modules will install, hit ctrl-c when done)
node node_modules/meshcentral --install
If I copy that folder manually everything works. Just thought I'd see if anyone else is having this issue or is there something else I need to be doing so this one can be closed. Thanks

OK, so you're still experiencing an issue... After reading this whole thread, I'm actually not sure what the actual issue is. Your description is ... a bit nebulous.

Can you possibly answer these questions:.
Is this issue occurring even when going through the extra step (described above by Ylianst) of directly running MeshCentral without the service once prior to running it with the --install parameter (to set up the service), or is the issue only occurring when you skip that step? Also, can you post the output of each of the commands, and describe the difference between the expected behavior and what's actually happening?

I don't see where it was suggested to run MeshCentral without --install. I have been running these npm commands in this order:
1-cd c:meshcentral
2-npm install meshcentral
3-node node_modules/meshcentral
3b-(wait, optional modules will install, hit ctrl-c when done)
4-node node_modules/meshcentral --install
I don't get any errors when going through all of the steps and MeshCentral service starts-initially. When I try to load the portal the service stops. The logs in the very first post gave me a hint as to what was happening. The node_modules folder gets removed after updating each time. If I copy it manually to this path: C:meshcentralnode_modulesmeshcentral with the included folders (minimist, node-windows and ws) the service stays running and everything works. I have to do this each time I upgrade and I have even tried a brand new install.

Here is the meshcentral.err.log
c:meshcentralnode_modulesnode-windowslibwrapper.js:177
child.send('shutdown');
^

TypeError: Cannot read property 'send' of null
at process.killkid (c:meshcentralnode_modulesnode-windowslibwrapper.js:177:11)
at process.emit (events.js:198:13)
at process.exit (internal/process/per_thread.js:168:15)
at monitor (c:meshcentralnode_modulesnode-windowslibwrapper.js:99:17)
at ChildProcess. (c:meshcentralnode_modulesnode-windowslibwrapper.js:170:5)
at ChildProcess.emit (events.js:198:13)
at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
c:meshcentralnode_modulesnode-windowslibwrapper.js:177
child.send('shutdown');
^

TypeError: Cannot read property 'send' of null
at process.killkid (c:meshcentralnode_modulesnode-windowslibwrapper.js:177:11)
at process.emit (events.js:198:13)
at process.exit (internal/process/per_thread.js:168:15)
at monitor (c:meshcentralnode_modulesnode-windowslibwrapper.js:99:17)
at ChildProcess. (c:meshcentralnode_modulesnode-windowslibwrapper.js:170:5)
at ChildProcess.emit (events.js:198:13)
at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)

Here is the meshcentral.out.log:
{ Error: Cannot find module 'c:meshcentralnode_modulesmeshcentralnode_modulesminimist'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at start (c:meshcentralnode_modulesmeshcentralwinservice.js:39:22)
at Object. (c:meshcentralnode_modulesmeshcentralwinservice.js:76:1)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12) code: 'MODULE_NOT_FOUND' }
{ Error: Cannot find module 'c:meshcentralnode_modulesmeshcentralnode_modulesminimist'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at start (c:meshcentralnode_modulesmeshcentralwinservice.js:39:22)
at Object. (c:meshcentralnode_modulesmeshcentralwinservice.js:76:1)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12) code: 'MODULE_NOT_FOUND' }
{ Error: Cannot find module 'c:meshcentralnode_modulesmeshcentralnode_modulesminimist'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at start (c:meshcentralnode_modulesmeshcentralwinservice.js:39:22)
at Object. (c:meshcentralnode_modulesmeshcentralwinservice.js:76:1)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12) code: 'MODULE_NOT_FOUND' }
{ Error: Cannot find module 'c:meshcentralnode_modulesmeshcentralnode_modulesminimist'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at start (c:meshcentralnode_modulesmeshcentralwinservice.js:39:22)
at Object. (c:meshcentralnode_modulesmeshcentralwinservice.js:76:1)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12) code: 'MODULE_NOT_FOUND' }
{ Error: Cannot find module 'c:meshcentralnode_modulesmeshcentralnode_modulesminimist'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at start (c:meshcentralnode_modulesmeshcentralwinservice.js:39:22)
at Object. (c:meshcentralnode_modulesmeshcentralwinservice.js:76:1)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12) code: 'MODULE_NOT_FOUND' }
{ Error: Cannot find module 'c:meshcentralnode_modulesmeshcentralnode_modulesminimist'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at start (c:meshcentralnode_modulesmeshcentralwinservice.js:39:22)
at Object. (c:meshcentralnode_modulesmeshcentralwinservice.js:76:1)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12) code: 'MODULE_NOT_FOUND' }

Here is the output of the commands. Even though there are errors I get past these no problem. The server stills dies and won't stay running unless I manually copy the folder as mentioned above from a previous install.

Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.

C:Windowssystem32>cd c:meshcentral

c:meshcentral>npm install meshcentral
npm WARN saveError ENOENT: no such file or directory, open 'c:meshcentralpacka
ge.json'
npm notice created a lockfile as package-lock.json. You should commit this file.

npm WARN enoent ENOENT: no such file or directory, open 'c:meshcentralpackage.
json'
npm WARN meshcentral No description
npm WARN meshcentral No repository field.
npm WARN meshcentral No README data
npm WARN meshcentral No license field.

  • [email protected]
    added 205 packages from 226 contributors and audited 486 packages in 27.631s
    found 0 vulnerabilities

c:meshcentral>node node_modules/meshcentral
Installing node-windows...
Installing otplib...
MeshCentral HTTP redirection server running on port 80.
Generating certificates, may take a few minutes...
Generating root certificate...
Generating HTTPS certificate...
Generating MeshAgent certificate...
Generating Intel AMT MPS certificate...
MeshCentral v0.4.2-u, LAN mode.
Server has no users, next new account will be site administrator.
MeshCentral HTTPS server running on port 443.
Server Ctrl-C exit...

c:meshcentral>node node_modules/meshcentral --install
Installing node-sspi...
Installing greenlock...
ERROR: Unable to install required module "greenlock". MeshCentral may not have a
ccess to npm, or npm may not have suffisent rights to load the new module. Try "
npm install greenlock" to manualy install this module.

c:meshcentral>node node_modules/meshcentral --install
Installing le-acme-core...
Installing nodemailer...
MeshCentral service installed.
MeshCentral service started.

c:meshcentral>npm install greenlock

[email protected] install c:meshcentralnode_modulesursa-optional
node rebuild.js

ursaNative bindings compilation fail. This is not an issue. Modules that depend
on it will use fallbacks.

[email protected] postinstall c:meshcentralnode_modulesacme-v2
node scripts/postinstall

Greenlock and ACME.js v3 are on the way!
Watch for updates at https://indiegogo.com/at/greenlock

npm WARN saveError ENOENT: no such file or directory, open 'c:meshcentralpacka
ge.json'
npm WARN enoent ENOENT: no such file or directory, open 'c:meshcentralpackage.
json'
npm WARN meshcentral No description
npm WARN meshcentral No repository field.
npm WARN meshcentral No README data
npm WARN meshcentral No license field.

  • [email protected]
    added 19 packages from 8 contributors and audited 1729 packages in 19.026s
    found 0 vulnerabilities

c:meshcentral>node node_modules/meshcentral --install
MeshCentral service already installed.

c:meshcentral>

Thanks. FYI, it's much easier to read code, commands, and command output of you put them in code blocks.

I'd recommend that you bypass all the extra steps of trying to get MeshCentral to install all of the optional modules by including them on the npm install command line. Looking at your command output from above, that would mean the following commands for you:

CD C:\meshcentral
npm install meshcentral node-windows otplib node-sspi greenlock le-acme-core nodemailer
node node_modules\meshcentral --install

As far as the missing npm package(s), after you've installed MeshCentral, but before you copy/move that folder, can you run npm list while you're in the C:\meshcentral folder, and post the results here?

Oh, also:

I don't see where it was suggested to run MeshCentral without --install. I have been running these npm commands in this order:
1-cd c:meshcentral
2-npm install meshcentral
3-node node_modules/meshcentral
3b-(wait, optional modules will install, hit ctrl-c when done)
4-node node_modules/meshcentral --install
I don't get any errors when going through all of the steps and MeshCentral service starts-initially. When I try to load the portal the service stops. The logs in the very first post gave me a hint as to what was happening. The node_modules folder gets removed after updating each time. If I copy it manually to this path: C:meshcentralnode_modulesmeshcentral with the included folders (minimist, node-windows and ws) the service stays running and everything works. I have to do this each time I upgrade and I have even tried a brand new install.

  • Thanks for the tip on "code blocks". I am not sure how to do this running these commands from Windows command line but I'm sure I can figure it out.
  • As for the "extra steps"; I don't normally do this and haven't in the past as the optional modules already installed.
  • I see what you are referring to now with regards to running command without --install initially. You can see from my command output that this is what I was actually doing.
  • I will attach the results of npm list below.
    Thanks for your help!

+-- [email protected]
| -- [email protected] +-- [email protected] | +-- [email protected] | +-- [email protected] | +-- [email protected] | |-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | +-- [email protected] deduped
| | +-- [email protected]
| | +-- [email protected] deduped
| | +-- [email protected] deduped
| | -- [email protected] | +-- [email protected] | |-- [email protected]
| +-- [email protected]
| | -- [email protected] | +-- [email protected] | +-- [email protected] | | +-- [email protected] deduped | | +-- [email protected] deduped | | +-- [email protected] deduped | |-- [email protected]
| -- [email protected] | +-- [email protected] |-- [email protected] deduped
+-- [email protected]
| +-- bignumber.[email protected] deduped
| +-- [email protected]
| +-- [email protected]
| | -- [email protected] |-- [email protected]
+-- [email protected]
| -- [email protected] +-- [email protected] | +-- [email protected] deduped | +-- [email protected] | +-- [email protected] deduped | +-- [email protected] deduped | +-- [email protected] | +-- [email protected] |-- [email protected]
+-- [email protected]
| +-- [email protected]
| | -- [email protected] |-- [email protected]
| +-- [email protected]
| +-- [email protected]
| -- [email protected] +-- [email protected] |-- [email protected] deduped
+-- [email protected]
+-- [email protected]
| +-- [email protected]
| | +-- [email protected] deduped
| | -- [email protected] | +-- [email protected] | |-- [email protected] deduped
| +-- [email protected] deduped
| -- [email protected] +-- [email protected] +-- [email protected] |-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
| +-- [email protected] deduped
| +-- [email protected] deduped
| +-- [email protected] deduped
| +-- [email protected] deduped
| +-- [email protected] deduped
| +-- [email protected] deduped
| +-- [email protected] deduped
| +-- [email protected] deduped
| +-- [email protected] deduped
| +-- [email protected] deduped
| +-- [email protected] deduped
| +-- [email protected] deduped
| +-- [email protected]
| | +-- [email protected] deduped
| | +-- [email protected] deduped
| | +-- [email protected] deduped
| | +-- [email protected] deduped
| | +-- [email protected] deduped
| | +-- [email protected] deduped
| | -- [email protected] deduped | +-- [email protected] | +-- [email protected] | +-- [email protected] | +-- [email protected] deduped | +-- [email protected] | +-- [email protected] | +-- [email protected] | | +-- [email protected] | |-- ipaddr.[email protected]
| +-- [email protected] deduped
| +-- [email protected]
| +-- [email protected] deduped
| +-- [email protected]
| | +-- [email protected] deduped
| | +-- [email protected] deduped
| | +-- [email protected] deduped
| | +-- [email protected] deduped
| | +-- [email protected] deduped
| | +-- [email protected] deduped
| | +-- [email protected] deduped
| | +-- [email protected] deduped
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected] deduped
| | +-- [email protected] deduped
| | -- [email protected] deduped | +-- [email protected] | | +-- [email protected] deduped | | +-- [email protected] deduped | | +-- [email protected] deduped | |-- [email protected] deduped
| +-- [email protected]
| +-- [email protected]
| +-- [email protected] deduped
| +-- [email protected]
| -- [email protected] deduped +-- [email protected] | +-- [email protected] deduped | +-- [email protected] | +-- [email protected] | | +-- [email protected] | | +-- [email protected] deduped | | +-- [email protected] | |-- [email protected]
| | +-- [email protected] deduped
| | -- [email protected] deduped | +-- [email protected] | | +-- [email protected] deduped | | +-- [email protected] | | +-- [email protected] | |-- [email protected] deduped
| -- [email protected] |-- [email protected] deduped
+-- [email protected]
| -- [email protected] |-- [email protected] deduped
+-- [email protected]
| -- [email protected] +-- [email protected] | +-- [email protected] | |-- [email protected] deduped
| +-- [email protected]
| +-- [email protected]
| | +-- @root/[email protected]
| | -- [email protected] deduped | +-- [email protected] | +-- [email protected] | | +-- @root/[email protected] | |-- [email protected]
| +-- [email protected]
| | +-- [email protected]
| | -- [email protected] | +-- [email protected] | |-- @root/[email protected] deduped
| +-- [email protected]
| +-- [email protected]
| | +-- @root/[email protected] deduped
| | +-- [email protected]
| | | -- [email protected] deduped | |-- [email protected] deduped
| -- [email protected] |-- [email protected] deduped
+-- [email protected]
+-- [email protected]
+-- [email protected]
| +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | | -- [email protected] | | +-- [email protected] | | +-- [email protected] | | +-- [email protected] | | | +-- [email protected] | | | +-- [email protected] deduped | | |-- [email protected] deduped
| | +-- [email protected]
| | | +-- [email protected]
| | | | +-- [email protected]
| | | | +-- [email protected]
| | | | +-- [email protected]
| | | | -- [email protected] | | | |-- [email protected]
| | | -- [email protected] | | +-- [email protected] | | | +-- [email protected] | | | +-- [email protected] | | | | +-- [email protected] deduped | | | | +-- [email protected] | | | | +-- [email protected] | | | |-- [email protected]
| | | | +-- [email protected] deduped
| | | | +-- [email protected] deduped
| | | | -- [email protected] deduped | | |-- [email protected]
| | | +-- [email protected]
| | | | -- [email protected] deduped | | | +-- [email protected] deduped | | | +-- [email protected] | | | |-- [email protected] deduped
| | | +-- [email protected]
| | | | -- [email protected] deduped | | | +-- [email protected] | | | | +-- [email protected] deduped | | | |-- [email protected] deduped
| | | +-- [email protected]
| | | | -- [email protected] deduped | | | +-- [email protected] | | | +-- [email protected] deduped | | |-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected] deduped
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected] deduped
| | +-- [email protected]
| | | +-- [email protected]
| | | -- [email protected] | | +-- [email protected] | | |-- [email protected] deduped
| | -- [email protected] |-- [email protected] extraneous
+-- [email protected]
| -- [email protected] deduped +-- [email protected] |-- [email protected] deduped
+-- [email protected]
| +-- [email protected] deduped
| +-- [email protected] deduped
| +-- [email protected] deduped
| +-- [email protected] deduped
| +-- [email protected] deduped
| +-- [email protected] deduped
| +-- [email protected] deduped
| +-- [email protected] deduped
| +-- [email protected] deduped
| +-- [email protected] deduped
| +-- [email protected] deduped
| +-- [email protected]
| +-- [email protected]
| | +-- [email protected] deduped
| | +-- [email protected] deduped
| | +-- [email protected] deduped
| | -- [email protected] | |-- [email protected]
| +-- [email protected]
| | +-- [email protected]
| | +-- [email protected] deduped
| | +-- [email protected] deduped
| | +-- [email protected]
| | | -- [email protected] | |-- [email protected] deduped
| +-- [email protected]
| +-- [email protected]
| | +-- [email protected]
| | | -- [email protected] deduped | | +-- [email protected] | | +-- [email protected] deduped | | +-- [email protected] | | | +-- [email protected] | | | |-- [email protected] deduped
| | | +-- [email protected]
| | | -- [email protected] deduped | |-- [email protected]
| +-- [email protected]
| | -- [email protected] deduped | +-- [email protected] |-- [email protected]
| +-- [email protected] deduped
| -- [email protected] deduped +-- [email protected] | +-- [email protected] | |-- [email protected]
| -- [email protected] +-- [email protected] | +-- [email protected] | | +-- [email protected] | |-- [email protected]
| -- [email protected] +-- [email protected] -- [email protected]
`-- [email protected]

npm ERR! extraneous: [email protected] C:meshcentralnode_modulesle-acme-coren
ode_modulesrsa-compat

C:meshcentral>

Sorry for the delay, I wrote a reply the other day, but accidentally hit the back button, and it disappeared, so I wasn't feeling very motivated to rewrite it again.

It looks like minimist, node-windows, and ws are all in the right places to me. Did you still have to copy/move things around after using npm to install the optional components from the beginning?

Also, to be a bit more specific about the code blocks, inline code should be 'quoted' in single 'backticks' (e.g. I ran `this command` in that folder), but multi-line code blocks should be placed between two lines that contain three backticks (```) on each of them, so while writing your post, it would look like so:

This is what I got when I ran `DIR /W meshcentral-data`:
```
 Volume in drive C is Windows
 Volume Serial Number is 92AE-5270

 Directory of C:\meshcentral\meshcentral-data

[.]                            [..]
agentserver-cert-private.key   agentserver-cert-public.crt
config.json                    meshcentral-events.db
meshcentral-power.db           meshcentral-smbios.db
meshcentral-stats.db           meshcentral.db
mesherrors.txt                 mpsserver-cert-private.key
mpsserver-cert-public.crt      root-cert-private.key
root-cert-public.crt           serverstate.txt
webserver-cert-private.key     webserver-cert-public.crt
              16 File(s)      1,156,401 bytes
               2 Dir(s)  483,540,668,416 bytes free
```

Also, another tip is that you can easily copy the output of a command to the clipboard on Windows by piping the command to CLIP, so if I'm posting the output from npm list, I would run npm list | CLIP, go to my GitHub reply and type `, `, `, Enter, Ctrl+V, Enter, `, `, `

No worries at all-I’ve done that before.
I’ve never had this issue with those components before the 0.4.x versions. I just noticed that after I upgraded; the service started and all seemed fine until I loaded the site. So if I am the only one having this issue I’ll need to investigate further. I know I haven’t changed my method of install/upgrading, so this is quite strange. I’ll post back if I come up with anything. Thanks for your help!

Did you still have to copy/move things around after using npm to install the optional components from the beginning?

No, I did not have to copy that node_modules folder with the 3 components (minimist, node-windows, and ws). I also did not have to install the optional components that you saw when I shared my script, i.e. letsencrypt, greenlock, etc., but this is not a big deal. One thing I thought about and I was going to try again was to not use my config.json when I do the new install-just for testing. I may have already tried this but can't remember. I will let you know the results.

This is the result of a brand new install without using my custom config.json:
'''

Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.

C:Windowssystem32>cd c:meshcentral

c:meshcentral>npm install meshcentral
npm WARN saveError ENOENT: no such file or directory, open 'c:meshcentralpacka
ge.json'
npm notice created a lockfile as package-lock.json. You should commit this file.

npm WARN enoent ENOENT: no such file or directory, open 'c:meshcentralpackage.
json'
npm WARN meshcentral No description
npm WARN meshcentral No repository field.
npm WARN meshcentral No README data
npm WARN meshcentral No license field.

  • [email protected]
    added 205 packages from 226 contributors and audited 486 packages in 39.544s
    found 0 vulnerabilities

c:meshcentral>node node_modules/meshcentral
Installing node-windows...
Installing otplib...
MeshCentral HTTP redirection server running on port 80.
Generating certificates, may take a few minutes...
Generating root certificate...
Generating HTTPS certificate...
Generating MeshAgent certificate...
Generating Intel AMT MPS certificate...
MeshCentral v0.4.2-z, LAN mode.
Server has no users, next new account will be site administrator.
MeshCentral HTTPS server running on port 443.
Server Ctrl-C exit...

c:meshcentral>node node_modules/meshcentral --install
MeshCentral service installed.
MeshCentral service started.

c:meshcentral>

'''

Still doing the same thing.

Ok, so I tried uninstalling everything, this includes npm and node.js and reinstalling-everything. Please note that this is and has always been installed on Windows Server 2012 R2, which was listed as supported OS in Install Guide; at least for the Windows Installation Tool. So...back to the original question: "why all of a sudden is the meshcentral service stopping?" Surely, something can be gleaned from the logs I have provided. I keep going back to the meshcentral.out.log and what is telling the service to look here ({ Error: Cannot find module 'c:meshcentralnode_modulesmeshcentral*node_modules*minimist') for these components...?

So, just to verify, please let me know if any of this is incorrect: You're trying to run the MeshCentral server is as a service, and after installing the service, it seems to start and operate normally, until you open a web browser and try to connect to it. At this point it crashes, and leaves something in the log about not being able to find minimist. As a workaround to the issue, you create a node_modules folder inside the meshcentral folder, where you place a minimist folder (containing minimist`).

Can you open up C:\Windows\System32\services.msc, open up the properties of the mesh central service, and post a screenshot, as well as copy/pasting the full contents of the "Path to executable:" field?

Yes, you are mostly correct:

  • The meshcentral service will stop even before I open up the web browser.
    Path to executable: "C:meshcentralnode_modulesmeshcentraldaemonmeshcentral.exe"
    Capture1-102419
  • It will only start and stay running if I copy the "minimist", "node-windows", and "ws" in the path you mentioned.
    Capture2-102419

Oh, well that's not what I expected. ... I guess I'll have to actually install it as a service some time to see what it's like.

When you say “...not what you expected” what do you mean? That’s how I’ve always ran it, so I’m wondering how many others do not run it as a service and that’s why this seems like such a remote issue.

I don't know how others use it, but I'm still primarily testing MeshCentral, and so far I've only run it via a portable version of node from https://github.com/jgonyea/nodejs-portable/releases, which I run, then through the command prompt that opens, I run npm install meshcentral, and node node_modules\meshcentral. To install it as a service, I'd first have to set up a proper install of node, or I'd have to use the MeshCentral installer.

When I said it was "not what I expected" I meant that I wasn't even aware that when installed as a service it gained a 'daemon' folder, which isn't present in my installation.

I was ready to give up on this but after walking away because of being so busy I revisited today and figured this out. Ylianst is it possible to change the winservice.js //setup libraries section to this:

// Setup libraries
const args = require(path.join(cwd, '../minimist'))(process.argv.slice(2));
const nodewindows = require(path.join(cwd, '../node-windows'));

When it is set to node_modules/minimist and node_modules/node_windows it is causing the meshcentral Windows service to crash after upgrading because it is expecting to find another node_modules folder under the meshcentral folder: (i.e. C:meshcentralnode_modulesmeshcentralnode_modules when it should be looking in the existing C:meshcentralnode_modules for the libraries, specifically node-windows and minimist.
With these changes in my winservice.js the Windows service starts and runs perfectly but I know it will get overwritten in future updates. Thanks

@Ylianst: johnczer is recommending the following changes to these lines: https://github.com/Ylianst/MeshCentral/blob/45043b20cd1d36effe9f799407efa087ba6e40a4/winservice.js#L38-L40

        // Setup libraries
-        const args = require(path.join(cwd, 'node_modules/minimist'))(process.argv.slice(2));
+        const args = require(path.join(cwd, '../minimist'))(process.argv.slice(2));
-        const nodewindows = require(path.join(cwd, 'node_modules/node-windows'));
+        const nodewindows = require(path.join(cwd, '../node-windows'));

I'm wondering though, wouldn't it be better to drop the path all together and let require() find these modules automatically? By default it should search through several locations, and I think the actual locations of these modules is among them, isn't it?

Ylianst is it possible to make the changes per above as this node_modules folder with minimist and node_windows still gets removed on upgrade and I have to replace it each time or service will not stay running.

@johnczer: Next time you update could you check if this change also works for you?

        // Setup libraries
-        const args = require(path.join(cwd, 'node_modules/minimist'))(process.argv.slice(2));
+        const args = require(minimist)(process.argv.slice(2));
-        const nodewindows = require(path.join(cwd, 'node_modules/node-windows'));
+        const nodewindows = require(node-windows);

I just tried this upgrade and I get the same result, which is it removes the expected node_modules folder from this path: C:meshcentralnode_modulesmeshcentral and I have to copy it back after every upgrade.
Before I sent this I checked to see if the winservice.js was already modified with the above changes in 4.8-x. So I manually added those lines and still the same result. I added my suggestions back in and the service started and stayed running. It doesn't expect the node_modules in the path specified above, which is how I would expect it to behave.

So, I'm experiencing the same issues. Once I installed MeshCentral (Windows Server 2016), I had to additionally install minimist and node-windows after _cd_ to ./node-modules/meshcentral and before I was able to run _node meshcentral --install_. When I updated my installation, I had to install additional modules once again

Was this page helpful?
0 / 5 - 0 ratings

Related issues

haxmachine picture haxmachine  Â·  3Comments

hellofaduck picture hellofaduck  Â·  3Comments

unguzov picture unguzov  Â·  3Comments

MailYouLater picture MailYouLater  Â·  4Comments

M1CK431 picture M1CK431  Â·  3Comments