Skip to content

Node repl crashes when trying to convert old JSON history file to new line separated one #4102

Closed
@zeusdeux

Description

@zeusdeux

If NODE_REPL_HISTORY_FILE was set as $HOME/.node_repl_history pre-v3.0 and if it is empty, running node (post-v3.0) throws.

Twitter conversation about this between @chrisdickinson, @Fishrock123 and myself is here.

Edit: So, I had NODE_REPL_HISTORY_FILE set to $HOME/.node_repl_history but I didn't have the file. Running node created an empty file and since oldHistoryPath was truthy in the call to onread in internal/repl.js, it tried to JSON.parse an empty string and threw.

Metadata

Metadata

Assignees

No one assigned

    Labels

    replIssues and PRs related to the REPL subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions