FabioAntunes / fish-nvm

nvm wrapper for fish-shell
MIT License
511 stars 20 forks source link

Can't launch node REPL anymore #34

Closed gubikmic closed 5 years ago

gubikmic commented 5 years ago

Hi, I'm stuck with the following error message that came up out of nowhere. I didn't even change anything that I remember but I can't launch a node REPL anymore:

~> node internal/modules/cjs/loader.js:651 throw err; ^

Error: Cannot find module '/Users/mmg' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:649:15) at Function.Module._load (internal/modules/cjs/loader.js:575:25) at Function.Module.runMain (internal/modules/cjs/loader.js:862:12) at internal/main/run_main_module.js:21:11

What works is env node and also launching a bash and then node.

I just reinstalled fisher, nvm, and fish-nvm but that didn't help.

Any ideas?

FabioAntunes commented 5 years ago

I have never experienced that, will need more info.

Open a new terminal session and do:

which node

Then do:

node -v

Then do:

which node

post the results here.

After all of that can you also can you try to install a new node version and then doing nvm use VERSION_YOU_INSTALLED

gubikmic commented 5 years ago

Thanks for your reply! Here's what I get:

 > which node
env: node: No such file or directory
 > node -v
v11.11.0
 > which node
/Users/mmg/.nvm/versions/node/v11.11.0/bin/node
 >

If I add an older node version and nvm use it, then the REPL works as expected.

FabioAntunes commented 5 years ago

Basically node repl is broken in nodejs from versions 11.10 and 11.11 for fish. If you install node from source you will be getting the same problem. Has nothing to do with fish-nvm.

FabioAntunes commented 5 years ago

I have created an issue here https://github.com/nodejs/node/issues/26663 feel free to follow that.

FabioAntunes commented 5 years ago

Found the issue it turns out it's actually on me.

FabioAntunes commented 5 years ago

Fixed on the latest version, just pull latest version

gubikmic commented 5 years ago

Awesome, thank you for the speedy fix!

huuanh1987 commented 5 years ago

internal/modules/cjs/loader.js:651 throw err; ^

Error: Cannot find module 'prompt' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:649:15) at Function.Module._load (internal/modules/cjs/loader.js:575:25) at Module.require (internal/modules/cjs/loader.js:705:19) at require (internal/modules/cjs/helpers.js:14:16) at Object. (/usr/local/lib/node_modules/react-native-cli/index.js:43:14) at Module._compile (internal/modules/cjs/loader.js:799:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:810:10) at Module.load (internal/modules/cjs/loader.js:666:32) at tryModuleLoad (internal/modules/cjs/loader.js:606:12) at Function.Module._load (internal/modules/cjs/loader.js:598:3)

HELP ME