n-riesco / ijavascript

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

No JS kernel listed -> IPython 3.0.0, OS X 10.10.2 #10

Closed JulianTonti closed 9 years ago

JulianTonti commented 9 years ago

image

{
  nodePath: 'node',
  ijsPath: '/usr/local/lib/node_modules/ijavascript/bin/ijavascript.js',
  rootPath: '/usr/local/lib/node_modules/ijavascript',
  kernelPath: '/usr/local/lib/node_modules/ijavascript/lib/kernel.js',
  kernelArgs: [
    'node',
    '/usr/local/lib/node_modules/ijavascript/lib/kernel.js',
    '/Users/julian',
    '{connection_file}' // <-- should this be a path to a connection.js file?
  ],
  ipythonArgs: [
    'notebook',
    '--KernelManager.kernel_cmd=[\'node\', \'/usr/local/lib/node_modules/ijavascript/lib/kernel.js\', \'/Users/julian\', \'{connection_file}\']'
  ],
  cwd: '/Users/julian'
}
{
  "control_port": 50160,
  "shell_port": 57503,
  "transport": "tcp",
  "signature_scheme": "hmac-sha256",
  "stdin_port": 52597,
  "hb_port": 42540,
  "ip": "127.0.0.1",
  "iopub_port": 40885,
  "key": "a0436f6c-1916-498b-8eb9-e81ab9368e84"
}

(from http://ipython.org/ipython-doc/dev/development/kernels.html )

... but didn't find anything. Any suggestions?

[edit] fixed it by creating a kernel.json file as follows:

cd ~/.ipython/kernels
mkdir javascript
subl ./javascript/kernel.json
{
  "display_name": "JavaScript",
  "argv": [
    "node",
    "/usr/local/lib/node_modules/ijavascript/lib/kernel.js",
    "/Users/julian",
    "{connection_file}"
  ],
  "language": "javascript"
}
n-riesco commented 9 years ago

--KernelManager.kernel_cmd has been deprecated in IPython 3.0.0. This means that the Javascript kernel appears listed as Python 2. I will look for a fix today.

n-riesco commented 9 years ago

Commit ba154a67bad312c15f02e2db670f9f8f68df8913 fixes this issue. I haven't released this commit to npm yet. To install it in your machine, you'll have to clone the git repository:

git clone https://github.com/n-riesco/ijavascript.git
npm install -g ./ijavascript
JulianTonti commented 9 years ago

Thanks Nicolas. Great work BTW, I poked around in your JS code and found it to be pleasantly clean and well structured. I approve!