0

I'm trying to make working a tool that I found on Github and I'm not able to get in touch with the creator of this.

I've this output:

const express = require('express'),
^^^^^
SyntaxError: Use of const in strict mode.
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:906:3

npm ERR! Windows_NT 6.2.9200
npm ERR! argv "D:\\Program Files (x86)\\nodejs\\0.10.29\\node.exe" "D:\\Program Files (x86)\\npm\\3.9.5\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v0.10.29
npm ERR! npm  v3.9.5
npm ERR! code ELIFECYCLE
npm ERR! PROJECT-NAME@0.0.0 start: `node ./app.js`
npm ERR! Exit status 8

How can I do (I'm using windows)?

Thank you so much!

KingFuzz
  • 3
  • 2
  • 2
    Possible duplicate of [SyntaxError: Use of const in strict mode](http://stackoverflow.com/questions/22603078/syntaxerror-use-of-const-in-strict-mode) – sytech Oct 27 '16 at 19:38
  • No, it's a different situation – KingFuzz Oct 27 '16 at 19:42
  • Have you tried updating the version of node you're using? There's also many different questions with this same problem. Please tell us what you have tried. – sytech Oct 27 '16 at 19:44
  • 1
    Try the top answer on the question that is linked ? Does it not work ? You could remove all occurences of `'use strict'` by hand of course –  Oct 27 '16 at 19:45
  • I tried to remove 'use strict' but there are a lot of other issues. I think that the problem is about the version of npm and node.js, but I don't know how to update them on windows server. – KingFuzz Oct 27 '16 at 19:59

1 Answers1

0

To enable some of the ECMAScript 2015 features (including const) in Node.js 0.10 start your node program with a harmony flag, otherwise you will get a syntax error. For example:

node --harmony app.js
enkryptor
  • 1,574
  • 1
  • 17
  • 27