n-riesco / ijavascript

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

Sudo install via npm v5 or above (--unsafe-perm) #146

Closed ghost closed 2 years ago

ghost commented 6 years ago

When installing the latest ijavascript via NPM globally to usr/local/ I get the error:

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! zeromq@4.6.0 install: node scripts/prebuild-install.js || (node scripts/preinstall.js && node-gyp rebuild) npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the zeromq@4.6.0 install script.


When installing ijavascript via NPM globally but with prefix set to local user directory ~/.npm-packages, it installs just find but cannot be executed i.s. "command not found".


Any help installing is greatly appreciated. I am trying to use this with Hydrogen for Atom.

System versions: Node - 9.5.0 NPM - 5.6.0 macOS - 10.13.3

n-riesco commented 6 years ago

@mink-code

When installing ijavascript via NPM globally but with prefix set to local user directory ~/.npm-packages, it installs just find but cannot be executed i.s. "command not found".

If prefix is set to ~/.npm-packages, the binaries will be located in ~/.npm-packages/bin. You need to make sure $HOME/.npm-packages/bin is in your PATH.


When installing the latest ijavascript via NPM globally to usr/local/ I get the error:

IJavascript depends on zeromq and sudo installations of zeromq with npm@5 don't work any longer, unless the flag --unsafe-perm is used. I.e. if you want to install IJavascript using sudo and npm@5 you need to run:

sudo npm install -g --unsafe-perm ijavascript
ghost commented 6 years ago

Ah, of course, thank you. Went with the first solution. ijsinstall runs now but can't find jupyter and ipython... are both required or is Hydrogen enough?

ghost commented 6 years ago

I installed both but Atom/Hydrogen now says:

'ijskernel' could not be spawned. Is it installed and on your path? If so please open an issue on the package spawning the process.

n-riesco commented 6 years ago

ijsinstall runs now but can't find jupyter and ipython... are both required or is Hydrogen enough?

If you want to use IJavascript with the latest Hydrogen, then you need to have jupyter.

'ijskernel' could not be spawned. Is it installed and on your path? If so please open an issue on the package spawning the process.

This means that Hydrogen doesn't have $HOME/.npm-packages/bin in its PATH. If you can't figure out the reason for this, then I'd install IJavascript's kernel spec with full paths, like this:

ijsinstall --spec-path=full

The drawback of using full paths is that the kernel spec needs reinstalling (i.e. ijsinstall --spec-path=full) every time node is updated (so that the kernel spec points to the new location of node).

ghost commented 6 years ago

ijsinstall --spec-path=full did the trick. Thank you.