From 6554d5b45267965c0c776ec4421d066097113931 Mon Sep 17 00:00:00 2001 From: Konstantin Tretyakov Date: Wed, 13 Dec 2017 17:38:08 +0100 Subject: [PATCH 1/2] Fix: process.env.HOME is undefined on Windows --- install.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/install.js b/install.js index 588fb84..e6b77b0 100644 --- a/install.js +++ b/install.js @@ -3,7 +3,12 @@ var fs = require('fs') var path = require('path') var mkdirp = require('mkdirp') -var installPath = path.join(process.env.HOME, '.ipython/kernels/nodejs') +var installPath; +if (process.platform == 'win32') // NB: this is true for both 32- and 64-bit Windows + installPath = path.join(process.env.APPDATA, 'jupyter/kernels/nodejs') +else + installPath = path.join(process.env.HOME, '.ipython/kernels/nodejs') + if (process.argv.length >= 3) { installPath = process.argv[2] } From 14018e1ff09b769ec0d88adbe858bd4d5c08bc11 Mon Sep 17 00:00:00 2001 From: Konstantin Tretyakov Date: Wed, 13 Dec 2017 17:52:22 +0100 Subject: [PATCH 2/2] Extended Windows-specific instructions --- Readme.md | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Readme.md b/Readme.md index d50e8f8..e4184e6 100644 --- a/Readme.md +++ b/Readme.md @@ -13,14 +13,14 @@ Get it while it's hot! or view the [example notebook](http://nbviewer.ipython.or ```bash git clone https://github.com/notablemind/jupyter-nodejs.git cd jupyter-nodejs -mkdir -p ~/.ipython/kernels/nodejs/ -npm install && node install.js +npm install +node install.js npm run build npm run build-ext jupyter console --kernel nodejs ``` -And viola! +And voilĂ ! ![image](https://cloud.githubusercontent.com/assets/112170/7268122/a33b186c-e882-11e4-8463-be00a6c90163.png) @@ -29,9 +29,19 @@ Also, in the iPython notebook: ![image](https://cloud.githubusercontent.com/assets/112170/7268108/70cade4e-e882-11e4-95e7-8a7375b3b888.png) +### Windows-specific installation notes +If the installation procedure above fails on `npm install`, complaining it cannot find the Python executable, try first installing `windows-build-tools` globally, by running as administrator: +```bash +npm install --global --production windows-build-tools +``` +Then also install [node-gyp](https://github.com/nodejs/node-gyp) and `zmq` globally (not necessarily as Administrator): +```bash +npm install --global node-gyp +npm install --global zmq +``` -## Supported features: +## Supported features - tab-completion (both for variables and **paths**) - error reporting