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

REPL cannot start due to error with loading history #33

Open
lordlycastle opened this issue Mar 31, 2021 · 4 comments
Open

REPL cannot start due to error with loading history #33

lordlycastle opened this issue Mar 31, 2021 · 4 comments

Comments

@lordlycastle
Copy link

I get this error when I try to run anything e.g. trymodule lodash:

Gonna start a REPL with packages installed and loaded for you
Couldn't find 'lodash' locally, gonna download it now
lodash@4.17.21 .trymodule/node_modules/lodash
Package 'lodash' was loaded and assigned to 'l' in the current scope
REPL started...
  /usr/local/lib/node_modules/trymodule/node_modules/repl.history/index.js:19
  repl.rli.addListener('line', function(code) {
           ^

TypeError: Cannot read property 'addListener' of undefined
    at module.exports (/usr/local/lib/node_modules/trymodule/node_modules/repl.history/index.js:19:12)
    at /usr/local/lib/node_modules/trymodule/cli.js:72:7
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:94:5)

I've done basic clean up steps i.e. uninstall trymodule and delete the ~/.trymodule/ folder (or trymodule --clear).

I don't understand why it fails here.

@kpman
Copy link

kpman commented Apr 12, 2021

@lordlycastle Which node version do you use?

@lordlycastle
Copy link
Author

@kpman see below.

├── trymodule@1.4.0
❯ node --version && npm --version
v15.10.0
7.7.6

@zeke
Copy link
Contributor

zeke commented Sep 20, 2021

I just ran into this. :[

$ trymodule file-size
Gonna start a REPL with packages installed and loaded for you
Couldn't find 'file-size' locally, gonna download it now
file-size@1.0.0 ../../../.trymodule/node_modules/file-size
Package 'file-size' was loaded and assigned to 'file_size' in the current scope
REPL started...
  /Users/z/.npm-global/lib/node_modules/trymodule/node_modules/repl.history/index.js:19
  repl.rli.addListener('line', function(code) {
           ^

TypeError: Cannot read properties of undefined (reading 'addListener')
    at module.exports (/Users/z/.npm-global/lib/node_modules/trymodule/node_modules/repl.history/index.js:19:12)
    at /Users/z/.npm-global/lib/node_modules/trymodule/cli.js:72:7
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

~/git/replicate/replicate-web main*
$ node --version
v16.9.0

@jopemachine
Copy link

jopemachine commented Nov 24, 2021

This issue is related with repl.history which is used in this module.

The node's repl API (REPLServer.rli) changed after Node 16.

The repl.rli.addListener should be replaced with repl.addListener.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants