Installing NPM packages in a Jupyter Notebook

705 Views Asked by At

I found a Docker package for Jupyterlab and it comes with the IJavaScript kernel:

docker run -d -p 8888:8888 liuderchi/jupyterlab-ijavascript:latest

I can create a new notebook using JavaScript.

How do I install NPM packages in this notebook?

I tried running a system command using % but I get an error:

> %npm ls

evalmachine.<anonymous>:1
%npm ls
^

SyntaxError: Unexpected token %
    at new Script (vm.js:73:7)
    at createScript (vm.js:245:10)
    at Object.runInThisContext (vm.js:297:10)
    at run ([eval]:1002:15)
    at onRunRequest ([eval]:829:18)
    at onMessage ([eval]:789:13)
    at process.emit (events.js:182:13)
    at emit (internal/child_process.js:811:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
0

There are 0 best solutions below