command-line-bootcamp / cli-boot.camp

:computer: command-line bootcamp adventure in your browser
https://cli-boot.camp/
Other
102 stars 51 forks source link

reliance on node v0.12 #20

Closed gedankenstuecke closed 6 years ago

gedankenstuecke commented 7 years ago

Hey there, I wanted to set this thing up for my lab, as we'll teach a class on shell & python next week and would have liked to spare the load to your public instance for the initial shell introduction. So I followed the README.md for setting up the docker backend, but I ran in some trouble with the node 0.12 requirement:

When you use node 0.12 you'll get the following when trying to run docker-browser-server:

/home/bastian/.nvm/versions/node/v0.12.18/lib/node_modules/docker-browser-server/node_modules/ws/index.js:9
const WebSocket = require('./lib/WebSocket');
^^^^^
SyntaxError: Use of const in strict mode.
    at exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:443:25)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/home/bastian/.nvm/versions/node/v0.12.18/lib/node_modules/docker-browser-server/index.js:3:23)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)

I think it's because docker-browser-server was significantly updated since the release of the CL Bootcamp and now makes use of much newer versions of all dependencies. Fetching an older version of docker-browser-server didn't help either, largely because all dependencies are listed as . When using the latest node version I can get docker-browser-server to run.

But that doesn't fully help either: I then deployed my fork of the CL bootcamp with the updated address and I can see that docker-browser-server tries starting the container, but immediately kills it again. Any ideas on what the easiest way would be to get a working local copy of the command_line_bootcamp? 😄

blahah commented 6 years ago

Sorry this took me a while to get to.

I looked into this today, and found that docker-browser-server didn't work with recent node versions. I found and fixed the bug in root - when that PR is merged and released I will PR to docker-browser-server to update it.

In the meantime, you can use npm install --global blahah/docker-browser-server to use my fork that includes the fix.

gedankenstuecke commented 6 years ago

No problem, we all have too many things on our minds! I appreciate that you looked into it and hope that people can profit from this! 👍

(For me personally it's a tad too late as I wanted to use this for a course with a local deployment end of last year, but next time around I'll have give it a try again! 😄)

alexmorley commented 6 years ago

The backend now runs fine using node 4.1.2.

Updated readme to reflect. #28

blahah commented 6 years ago

Thanks @gedankenstuecke for reporting and @alexmorley for updating, testing, and getting the site back up :)