1

I have developed a nodejs application for a client, but obviously asking a client to install nodejs and npms in their system does not look good.

NPM's does not work if we simply copy paste them, we require to do npm install 'npm name', which is also an issue.

Assuming that client does not have internet access in their system, I want a single exe or some file which on click can work without any need to install any npms or nodejs. Is there something which can make it happen? I am sure there must be, which I am missing. I will be grateful if someone can help me in this

Thanks in advance

UPDATE

I am not getting option to answer my question so updating the question itself

How to install NodeJS project locally without internet connection?

this was really helpful.. that is how I can zip my modules and install it at some other machine .. and

https://github.com/jxcore/jxcore

this can be useful to run project as a single file

Community
  • 1
  • 1
Priyanka
  • 806
  • 1
  • 9
  • 21

3 Answers3

2

Kinda hacky, but you could run an electron (atom-shell) instance without showing the browser window and use the main process as a Node.js playground.

For any references about building and deploying Electron

Phugo
  • 400
  • 1
  • 10
  • Hacky is no good. They need to be taught the best and most practical methods. Not work around's or out of the norm resolutions like this. – Blake Connally Mar 11 '17 at 07:31
  • The only _hacky_ part is actually the "not showing browser window" one, but if you don't need any GUI, probably that is not that _hacky_. – Phugo Mar 11 '17 at 07:35
  • @ZephyrPellerin Agreed. Assuming your client doesn't have internet access on their server. Is that a joke? – Blake Connally Mar 11 '17 at 07:36
2

The professional way to do this is to build a locally-installable package for your client's appropriate package management system.

All major Unix-derived operating systems (and even Windows, sortof) ship with a robust package management system which was designed with this sort of scenario in mind.

  • Fedora / Redhat / CentOS - Building an RPM package
  • Ubuntu / Debian / Windows (Windows Subsystem for Linux) - Building a DPKG
  • Mac OSX - pkgbuild
  • FreeBSD / OpenBSD - This is a bit trickier to do for a package like Node.JS for a number of reasons, but there are plenty of resources online.

If you or your clients can't provide the Windows Subsystem for Linux, there are perhaps dozens of projects from nexe to the Closure compiler for building a Node project as a single executable for a diverse set of platforms.

If you've got the itching feeling that you have too much free time, V8 also includes tooling for targeting code emitted from CrankShaft for arbitrary instruction sets with the d8 debugger. I've heard stories of sufficiently "sophisticated" (read: unhinged) programmers wrapping this in a PE/COFF for Windows à la SBCL Common Lisp 'core dumps'.

zetavolt
  • 2,989
  • 1
  • 23
  • 33
-1

SSH into their system and install it. Not hard at all. Depending on their operating system would determine the steps needed to be taken. That's the only proper way to do it. I do it for clients on the daily.

Blake Connally
  • 689
  • 1
  • 4
  • 16