rebase-editor
rebase-editor copied to clipboard
Cannot open rebase-editor
git rebase -i HEAD~2
hint: Waiting for your editor to close the file... /usr/local/lib/node_modules/rebase-editor/lib/reducer.js:148
return state.lines[pos]?.action
^
SyntaxError: Unexpected token '.'
at wrapSafe (internal/modules/cjs/loader.js:915:16)
at Module._compile (internal/modules/cjs/loader.js:963:27)
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)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/usr/local/lib/node_modules/rebase-editor/lib/main.js:3:12)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
error: There was a problem with the editor 'rebase-editor'.
https://github.com/sjurba/rebase-editor/blob/15925487ad456382dcf5b88f7e84d3cb57f300c1/lib/reducer.js#L148
I could edit by vim.

It works with
npm --version 6.14.12
node --version: v14.16.1
I had the same issue on ubuntu 20 and it was because my nodejs version was outdated (10.x). Followed this stack overflow answer to fix:
sudo npm install -g n
sudo n lts