You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.
Hello, I'm trying to build a project made with terminal-kit for all platforms, but I can't get it to build I think due to non-literal require calls. It builds without errors, but running it throws this error:
pkg/prelude/bootstrap.js:1833throwerror;^
Error: Cannotfindmodule'./termconfig/xterm.generic.js'
Require stack:
- \node_modules\terminal-kit\lib\Terminal.js- \node_modules\terminal-kit\lib\termkit.js- \bin\index.js1)Ifyouwanttocompilethepackage/fileintoexecutable,pleasepayattentiontocompilationwarningsandspecifyaliteralin'require'call.2)Ifyoudon'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 (node:internal/modules/cjs/loader:933:15) at Function._resolveFilename (pkg/prelude/bootstrap.js:1912:46) at Function.Module._load (node:internal/modules/cjs/loader:778:27) at Module.require (node:internal/modules/cjs/loader:999:19) at Module.require (pkg/prelude/bootstrap.js:1812:31) at require (node:internal/modules/cjs/helpers:102:18) at Object.createTerminal (\node_modules\terminal-kit\lib\Terminal.js:159:18) at terminal (\node_modules\terminal-kit\lib\termkit.js:119:18) at Object.get [as terminal] (\node_modules\lazyness\lib\Lazyness.js:48:16) at Object.<anonymous> (\bin\index.js:8:20) { code: 'MODULE_NOT_FOUND',requireStack: ['\\node_modules\\terminal-kit\\lib\\Terminal.js','\\node_modules\\terminal-kit\\lib\\termkit.js','\\bin\\index.js'],pkg: true}Node.jsv17.8.0
I believe this is the piece of code: Terminal.js from l:138
if(!termconfig){// The real terminal app is not known, or we fail to load it...// Fallback to the terminal generic (most of time, got from the $TERM env variable).try{// If a .generic.js file exists, this is a widely used terminal generic, 'xterm' for example.// We should use this generic files because despite advertising them as 'xterm',// most terminal sucks at being truly 'xterm' compatible (only 33% to 50% of xterm capabilities// are supported, even gnome-terminal and Konsole are bad).// So we will try to maintain a fail-safe xterm generic config.term.termconfigFile=term.generic+'.generic.js'termconfig=require('./termconfig/'+term.termconfigFile)}catch(error){try{// No generic config exists, try a specific configterm.termconfigFile=term.generic+'.js'termconfig=require('./termconfig/'+term.termconfigFile)}catch(error_){// Nothing found, fallback to the most common terminal genericterm.termconfigFile='xterm.generic.js'termconfig=require('./termconfig/'+term.termconfigFile)// changing the above line to: termconfig = require('./termconfig/xterm.generic.js') compiles, runs but shows nothing in terminal}}}
How could I rewrite this to support building? I looked around and saw that this isn't the only non literal require. Or if it isn't necessary, then how could I make it work? Trying the fixes suggested in other similar issues don't seem to work for me, I think I applied them right in my package.json.
Thanks, dj
This issue is stale because it has been open 90 days with no activity. Remove the stale label or comment or this will be closed in 5 days. To ignore this issue entirely you can add the no-stale label
What version of pkg are you using?
5.5.2
What version of Node.js are you using?
16.14.0
What operating system are you using?
Windows
What CPU architecture are you using?
x86_64
What Node versions, OSs and CPU architectures are you building for?
latest-win-x64, latest-macos-x64, latest-linux-x64
Describe the Bug
Hello, I'm trying to build a project made with terminal-kit for all platforms, but I can't get it to build I think due to non-literal require calls. It builds without errors, but running it throws this error:
I believe this is the piece of code:
Terminal.js from l:138
My
package.json
:How could I rewrite this to support building? I looked around and saw that this isn't the only non literal require. Or if it isn't necessary, then how could I make it work? Trying the fixes suggested in other similar issues don't seem to work for me, I think I applied them right in my
package.json
.Thanks, dj
Similar git issues: nexe/509
pkg/1018
some forum post
Expected Behavior
To build and execute correctly.
To Reproduce
npm init
npm install pkg terminal-kit
test.js
:package.json
:npm run build
8mb-win.exe
:ERRROR
The text was updated successfully, but these errors were encountered: