JohnMcLear / draw

A real time collaborative drawing tool using nodejs, socket.io & paper.js
Apache License 2.0
482 stars 158 forks source link

SyntaxError: Use of const in strict mode. #185

Closed opnoack closed 9 years ago

opnoack commented 9 years ago

I receive the following error when trying to start etherdraw:

~/draw$ node server.js
DirtyDB is used. This is fine for testing but not recommended for production.
/home/user/draw/node_modules/paper/node_modules/jsdom/lib/jsdom/living/helpers/validate-names.js:2
const xnv = require("xml-name-validator");
^^^^^
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/user/draw/node_modules/paper/node_modules/jsdom/lib/jsdom/level1/core.js:8:20)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)

OS: Ubuntu Trusty Thar 14.04 LTS Node: 0.12.0 Installed packages: libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev build-essential g++ npm

What is causing the problem and how can I solve it?

JohnMcLear commented 9 years ago

I get the same error, looks like something got b0rked upstream

JohnMcLear commented 9 years ago

Upstream issue https://github.com/paperjs/paper.js/issues/641

JohnMcLear commented 9 years ago

git pull and npm install. It should be fixed

opnoack commented 9 years ago

Thanks for the speedy reply. Sadly there is another error now:

~$ draw/bin/run.sh                                                                                           
Ensure that all dependencies are up to date...
start...
DirtyDB is used. This is fine for testing but not recommended for production.
/home/user/draw/node_modules/paper/node_modules/jsdom/node_modules/contextify/node_modules/bindings/bindings.js:83
        throw e
              ^
Error: Module did not self-register.
    at Error (native)
    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 bindings (/home/user/draw/node_modules/paper/node_modules/jsdom/node_modules/contextify/node_modules/bindings/bindings.js:76:44)
    at Object.<anonymous> (/home/user/draw/node_modules/paper/node_modules/jsdom/node_modules/contextify/lib/contextify.js:1:96)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
JohnMcLear commented 9 years ago

It's working fine for me now, try clear out your node_modules folder and try again..

JohnMcLear commented 9 years ago

It's because you are running node 0.12...

opnoack commented 9 years ago

You are absolutely right, I downgraded to 0.11 and now it's working :) Thanks!