n-riesco / ijavascript

IJavascript is a javascript kernel for the Jupyter notebook
Other
2.19k stars 185 forks source link

Hydrogen cannot locate IJavascript kernel for grammar `JavaScript with JSX` #209

Closed noahlearner closed 4 years ago

noahlearner commented 4 years ago

I have installed Hydrogen package in Atom on my Mac running Mojave.

I also have Python 3.7.3 set as default version.

When I open a js file and select a line of code and hit ⌘ + return I get the error:

No kernel for grammar JavaScript with JSX found Check that the language for this file is set in Atom, that you have a Jupyter kernel installed for it, and that you have configured the language mapping in Hydrogen preferences.

I don't understand how to efficiently troubleshoot how to get this working.

I followed the steps in this comment: https://github.com/nteract/hydrogen/issues/944#issuecomment-369665959

I have also confirmed that Jupyter notebook is installed, and that ijavascipt kernel is installed on machine.

Here's the output from my Jupyter Kernel.json

{ "kernelspecs": { "javascript": { "resource_dir": "/Users/smartetailing/Library/Jupyter/kernels/javascript", "spec": { "argv": [ "ijskernel", "--hide-undefined", "{connection_file}", "--protocol=5.1" ], "env": {}, "display_name": "Javascript (Node.js)", "language": "javascript", "interrupt_mode": "signal", "metadata": {} } }, "python3": { "resource_dir": "/Library/Frameworks/Python.framework/Versions/3.7/share/jupyter/kernels/python3", "spec": { "argv": [ "python", "-m", "ipykernel_launcher", "-f", "{connection_file}" ], "env": {}, "display_name": "Python 3", "language": "python", "interrupt_mode": "signal", "metadata": {} } } } }

n-riesco commented 4 years ago

What do you get when you run jupyter-kernelspec list?

noahlearner commented 4 years ago

Available kernels: javascript /Users/smartetailing/Library/Jupyter/kernels/javascript python3 /Library/Frameworks/Python.framework/Versions/3.7/share/jupyter/kernels/python3

n-riesco commented 4 years ago

Could you run the command Hydrogen: Update Kernels in Atom and see if this makes any difference?

noahlearner commented 4 years ago

Do I hit ⌘ + r then enter the command in the popup?

n-riesco commented 4 years ago

Oh, I think I see what the problem could be. The detected language is JavaScript with JSX not just JavaScript. There is a setting in hydrogen to workaround this.

Try to set { "javascript": "JavaScript with JSX" } to languageMappings

noahlearner commented 4 years ago

progress and with a new error:

`nternal/modules/cjs/loader.js:984 throw err; ^

Error: Cannot find module '../build/Release/zmq.node' Require stack:

/usr/local/lib/node_modules/ijavascript/node_modules/zeromq/lib/index.js /usr/local/lib/node_modules/ijavascript/node_modules/zeromq/index.js /usr/local/lib/node_modules/ijavascript/node_modules/jmp/index.js /usr/local/lib/node_modules/ijavascript/node_modules/jp-kernel/lib/jp-kernel.js /usr/local/lib/node_modules/ijavascript/node_modules/jp-kernel/index.js /usr/local/lib/node_modules/ijavascript/lib/kernel.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:981:15) at Function.Module._load (internal/modules/cjs/loader.js:863:27) at Module.require (internal/modules/cjs/loader.js:1043:19) at require (internal/modules/cjs/helpers.js:77:18) at Object. (/usr/local/lib/node_modules/ijavascript/node_modules/zeromq/lib/index.js:6:11) at Module._compile (internal/modules/cjs/loader.js:1157:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1177:10) at Module.load (internal/modules/cjs/loader.js:1001:32) at Function.Module._load (internal/modules/cjs/loader.js:900:14) at Module.require (internal/modules/cjs/loader.js:1043:19) { code: 'MODULE_NOT_FOUND', requireStack: [ '/usr/local/lib/node_modules/ijavascript/node_modules/zeromq/lib/index.js', '/usr/local/lib/node_modules/ijavascript/node_modules/zeromq/index.js', '/usr/local/lib/node_modules/ijavascript/node_modules/jmp/index.js', '/usr/local/lib/node_modules/ijavascript/node_modules/jp-kernel/lib/jp-kernel.js', '/usr/local/lib/node_modules/ijavascript/node_modules/jp-kernel/index.js', '/usr/local/lib/node_modules/ijavascript/lib/kernel.js' ] }`

n-riesco commented 4 years ago

That error could happen if the version of node.js has changed after installing IJavascript. Usually uninstalling and installing IJavascript fixes the problem.

noahlearner commented 4 years ago

Woo-Hooooooo!!! Thanks so much!!!!!!!!!!!!!!