Skip to content

Instantly share code, notes, and snippets.

@glor
Created June 16, 2022 10:48
Show Gist options
  • Save glor/dc0c7912682d11f2c89e168c85d894b0 to your computer and use it in GitHub Desktop.
Save glor/dc0c7912682d11f2c89e168c85d894b0 to your computer and use it in GitHub Desktop.
Add a locally installed JavaScript (node.js) Kernel to a hosted Jupyter(Lab) instance, permanently
#!/bin/bash
# Dependency: node and npm must be installed on the jupyter(lab) instance. This could probably also be hacked around using nvm (node version manager)
cd
npm i ijavascript
npx ijsinstall
sed -i 's/ijskernel/node", "\/home\/jovyan\/node_modules\/ijavascript\/lib\/kernel\.js/g' .local/share/jupyter/kernels/javascript/kernel.json
echo "Try to refresh the page (F5). JavaScript notebook and console should be available then."
# And as a one-liner for copy&paste:
# cd && npm i ijavascript && npx ijsinstall && sed -i 's/ijskernel/node", "\/home\/jovyan\/node_modules\/ijavascript\/lib\/kernel\.js/g' .local/share/jupyter/kernels/javascript/kernel.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment