Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempting to convert old non-existing history file fails #2449

Closed
toddself opened this issue Aug 19, 2015 · 5 comments
Closed

Attempting to convert old non-existing history file fails #2449

toddself opened this issue Aug 19, 2015 · 5 comments
Labels
repl Issues and PRs related to the REPL subsystem.

Comments

@toddself
Copy link
Contributor

Just upgraded to 3.0.0 from 0.10.28 on linux.

↳ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.3 LTS
Release:    14.04
Codename:   trusty

trying to launch the repl results in:

todd@scripto-local 18:14:50 /home/.../src/deploybot:couch
↳ node
>
Converting old JSON repl history to line-separated history.
The new repl history file can be found at /home/todd/.node_repl_history.
> node.js:129
              throw err;
              ^

Error: Could not parse history data in /home/todd/.node-history.
    at onread (internal/repl.js:126:13)
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:380:3)
todd@scripto-local 18:16:22 /home/.../src/deploybot:couch
↳ node --version
v3.0.0

This seems to be due to the fact that i have NODE_REPL_HISTORY_FILE set, but there is no actual file present:

todd@scripto-local 18:16:24 /home/.../src/deploybot:couch
↳ echo $NODE_REPL_HISTORY_FILE
/home/todd/.node-history
todd@scripto-local 18:16:48 /home/.../src/deploybot:couch
↳ cat $NODE_REPL_HISTORY_FILE
cat: /home/todd/.node-history: No such file or directory
@toddself
Copy link
Contributor Author

I have a potential fix for this -- am verifying it and writing tests

@thefourtheye thefourtheye added the repl Issues and PRs related to the REPL subsystem. label Aug 19, 2015
@thefourtheye
Copy link
Contributor

ping @Fishrock123

@toddself
Copy link
Contributor Author

I'm not sure if it needs more tests than that? (Or if that's a valid test?)

The resulting binary works correctly for me.

@Fishrock123
Copy link
Contributor

Isn't this the expected behavior, that option would have done that before?

Edit: ah I understand, before it would have made a file.

Fishrock123 pushed a commit that referenced this issue Aug 20, 2015
If you have no history file written to disk, but the environment
variable set, `fs.readFileSync` will throw an ENOENT error,
but there's nothing to convert. The converter should ignore
ENOENT on that `fs.readFileSync` call.

Fixes: #2449
PR-URL: #2451
Reviewed-By: Jeremiah Senkpiel <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
@Fishrock123
Copy link
Contributor

Fixed by 3849750 :)

rvagg pushed a commit that referenced this issue Aug 21, 2015
If you have no history file written to disk, but the environment
variable set, `fs.readFileSync` will throw an ENOENT error,
but there's nothing to convert. The converter should ignore
ENOENT on that `fs.readFileSync` call.

Fixes: #2449
PR-URL: #2451
Reviewed-By: Jeremiah Senkpiel <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
@BridgeAR BridgeAR mentioned this issue Jun 21, 2017
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
repl Issues and PRs related to the REPL subsystem.
Projects
None yet
Development

No branches or pull requests

3 participants