Ubuntu Server 20.04: oputil.js gives 'flat is not a function' error
See original GitHub issueDescribe the Bug
Attempting to install using curl script, which appears to complete without issue. Unable to complete initial config due to ./oputil.js config new
erroring out with
(node:319138) UnhandledPromiseRejectionWarning: TypeError: this.breakLines(...).flat is not a function
Will include full terminal output below
To Reproduce
Just run ./oputil.js config new
after initial install. Tried npm rebuild
with no effect.
Expected Behavior Expected prompts associated with first run configuration.
Actual Behavior
analytic@origin:~/enigma-bbs$ ./oputil.js config new
(node:319138) UnhandledPromiseRejectionWarning: TypeError: this.breakLines(...).flat is not a function
at ScreenManager.forceLineReturn (/home/analytic/enigma-bbs/node_modules/inquirer/lib/utils/screen-manager.js:172:56)
at ScreenManager.render (/home/analytic/enigma-bbs/node_modules/inquirer/lib/utils/screen-manager.js:81:20)
at ConfirmPrompt.render (/home/analytic/enigma-bbs/node_modules/inquirer/lib/prompts/confirm.js:70:17)
at ConfirmPrompt._run (/home/analytic/enigma-bbs/node_modules/inquirer/lib/prompts/confirm.js:51:10)
at Promise (/home/analytic/enigma-bbs/node_modules/inquirer/lib/prompts/base.js:61:12)
at new Promise (<anonymous>)
at ConfirmPrompt.run (/home/analytic/enigma-bbs/node_modules/inquirer/lib/prompts/base.js:60:12)
at defer (/home/analytic/enigma-bbs/node_modules/inquirer/lib/ui/prompt.js:105:30)
at Observable._subscribe (/home/analytic/enigma-bbs/node_modules/rxjs/dist/cjs/internal/observable/defer.js:8:31)
at Observable._trySubscribe (/home/analytic/enigma-bbs/node_modules/rxjs/dist/cjs/internal/Observable.js:41:25)
(node:319138) 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(). (rejection id: 3)
(node:319138) [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.
Tried updating to latest version of nodejs and seem to have made matters worse:
./oputil.js config new
internal/modules/cjs/loader.js:818
throw err;
^
Error: Cannot find module '/home/analytic/enigma-bbs/node_modules/sqlite3/lib/binding/node-v72-linux-x64/node_sqlite3.node'
Require stack:
- /home/analytic/enigma-bbs/node_modules/sqlite3/lib/sqlite3-binding.js
- /home/analytic/enigma-bbs/node_modules/sqlite3/lib/sqlite3.js
- /home/analytic/enigma-bbs/core/database.js
- /home/analytic/enigma-bbs/core/oputil/oputil_common.js
- /home/analytic/enigma-bbs/core/oputil/oputil_main.js
- /home/analytic/enigma-bbs/oputil.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
at Function.Module._load (internal/modules/cjs/loader.js:667:27)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/home/analytic/enigma-bbs/node_modules/sqlite3/lib/sqlite3-binding.js:4:15)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/home/analytic/enigma-bbs/node_modules/sqlite3/lib/sqlite3-binding.js',
'/home/analytic/enigma-bbs/node_modules/sqlite3/lib/sqlite3.js',
'/home/analytic/enigma-bbs/core/database.js',
'/home/analytic/enigma-bbs/core/oputil/oputil_common.js',
'/home/analytic/enigma-bbs/core/oputil/oputil_main.js',
'/home/analytic/enigma-bbs/oputil.js'
]
}
Environment
-
I am using Node.js v12.x LTS or higher
-
npm install
oryarn
reports success -
Actual Node.js version (
node --version
): 12.22.12 -
Operating system (
uname -a
on *nix systems): Linux origin 5.4.0-109-generic #123-Ubuntu SMP Fri Apr 8 09:10:54 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux -
Revision (
git rev-parse --short HEAD
): ac38ac9e
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
Just started it up successfully. Thanks for seeing me over the finish line!
Re-ran npm rebuild and now it seems to be working. Will leave this thread up just in case someone else hits this snag…