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
On startup, the REPL looks for its history file at .sibilant.history in the user's home directory. See repl.sibilant line 12: (var ... HISTORY-FILE (|> process.env.SIBILANT-REPL-HISTORY-FILE (or (""process.env.HOME"/.sibilant.history")))
However, on Windows machine this may fail because process.env.HOME is not set by default. Windows does not set this environment variable unless the user explicitly does so, using the environment variable USERPROFILE instead. This results in an error like the following:
Error: ENOENT: no such file or directory, open 'undefined/.sibilant.history'
at Object.openSync (fs.js:462:3)
at Object.<anonymous> (C:\<redacted>\stitch-sibilant-challenge\node_modules\sibilant\maps\src\repl.sibilant:26:12)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.cli$repl$ [as repl] (C:\<redacted>\node_modules\sibilant\maps\src\cli.sibilant:37:7)
at Object.<anonymous> (C:\<redacted>\node_modules\sibilant\maps\src\cli.sibilant:78:8)
A better approach would be to use Node's os.homedir() instead of process.env, as os.homedir() is more reliable across multiple OSes and environments.
The text was updated successfully, but these errors were encountered:
JordanRickman
changed the title
Use os.homedir() instead of process.env.HOME in REPL.
REPL fails on startup on Windows machines.
Oct 18, 2020
On startup, the REPL looks for its history file at
.sibilant.history
in the user's home directory. Seerepl.sibilant
line 12:(var ... HISTORY-FILE (|> process.env.SIBILANT-REPL-HISTORY-FILE (or (""process.env.HOME"/.sibilant.history")))
However, on Windows machine this may fail because
process.env.HOME
is not set by default. Windows does not set this environment variable unless the user explicitly does so, using the environment variableUSERPROFILE
instead. This results in an error like the following:A better approach would be to use Node's
os.homedir()
instead ofprocess.env
, asos.homedir()
is more reliable across multiple OSes and environments.The text was updated successfully, but these errors were encountered: