question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Closed Automatically At Exporting .exe With pkg

See original GitHub issue

I don’t know why, but when I try to export a .exe file with terminal-kit, the .exe file is closed automatically. How do I know what is caused by terminal-kit?, 'cause When I Retire terminal-kit of my code the exported .exe is working perfectly.

If anyone want to see my code, is here, but I repeat, when I retire “require(‘terminal-kit’)” the .exe works. But in terminal with “node index.js” it’s working fine with terminal-kit.

var term = require('terminal-kit').terminal;
var User = require('./user.js');

setInterval(function() {
    console.log("timer that keeps nodejs processing running");
}, 1000 * 60 * 60);

console.clear = function(){
	var lines = process.stdout.getWindowSize()[1];
	for(var i = 0; i < lines; i++) {
	    console.log('\r\n');
	}
}

//STARTS LOADING USER Data
User.Load();
if(User.Data.language == null){
	console.clear();
	console.log( 'Select Language:\n' ) ;
	var items = [
		'> English' ,
		'> Spanish'
	] ;

	term.singleColumnMenu( items , function( error , response ) {
		term( '\n' ).eraseLineAfter.green(
			"#%s selected: %s (%s,%s)\n" ,
			response.selectedIndex ,
			response.selectedText ,
			response.x ,
			response.y
		) ;
		process.exit() ;
	} ) ;
}
//========================

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
envis10ncommented, Nov 29, 2018

This is more than likely the issue. "pkg": { "assets": "node_modules/terminal-kit/**/*" } Add this to your package.json and try it again.

0reactions
reberthksscommented, Jun 19, 2020

i’ve same problem. Also added the snippet-code mencioned by @envis10n . I’m getting the follow message :

PS E:\cernov-apps\print-server-marines> ./index.exe (node:10284) UnhandledPromiseRejectionWarning: Error: Cannot find module ‘./termconfig/xterm.generic.js’ Require stack:

  • E:\snapshot\print-server-marines\node_modules\terminal-kit\lib\Terminal.js
  • E:\snapshot\print-server-marines\node_modules\terminal-kit\lib\termkit.js
  • E:\snapshot\print-server-marines\selectPrinterMenu.js
  • E:\snapshot\print-server-marines\index.js
  1. If you want to compile the package/file into executable, please pay attention to compilation warnings and specify a literal in ‘require’ call. 2) If you don’t want to compile the package/file into executable and want to ‘require’ it from filesystem (likely plugin), specify an absolute path in ‘require’ call using process.cwd() or process.execPath. at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1012:15) at Function.Module._resolveFilename (pkg/prelude/bootstrap.js:1346:46) at Function.Module._load (internal/modules/cjs/loader.js:882:27) at Module.require (internal/modules/cjs/loader.js:1072:19) at Module.require (pkg/prelude/bootstrap.js:1225:31) at require (internal/modules/cjs/helpers.js:72:18) at Object.createTerminal (E:\snapshot\print-server-marines\node_modules\terminal-kit\lib\Terminal.js:159:18) at terminal (E:\snapshot\print-server-marines\node_modules\terminal-kit\lib\termkit.js:106:18) at Object.get [as terminal] (E:\snapshot\print-server-marines\node_modules\lazyness\lib\Lazyness.js:48:16) at E:\snapshot\print-server-marines\index.js (Use index --trace-warnings ... to show where the warning was created) (node:10284) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2) (node:10284) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Pyinstaller's .exe file closes immediately - python
I got it working by dragging the main.exe file to a open command prompt and then pressed enter and it worked, and I...
Read more >
Compiling a Node.js Application into an .exe File - Section.io
In this article, we will discuss the reasons for converting an application into a .exe file and finally understand the technical details ...
Read more >
Manual Deployment Using Packages for Export
The package installation program automatically detects the computer type and installs the applicable components. Closed Creating or Changing a Package for ...
Read more >
Issues When Using auto-py-to-exe - Nitratine
The Terminal Just Opens and Closes But There Are No Errors; 'python'/'pip'/'auto-py-to-exe' is not recognised as an internal or external ...
Read more >
How to create an executable (.exe) file from JavaScript code ...
During the compilation process, pkg looks at the require() statements in the code and automatically include these files as static assets.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found