3

I am trying to use the Aurelia-cli tool to create a new Aurelia project. I am using a Windows 10 machine with node and git installed.

I created a new empty folder for the project, and opened a command prompt and navigated to this folder.

I then ran the following command which completed successfully:

npm install -g aurelia-cli

Then I ran the following to create a new project:

au new

But this gave the following error:

C:\Users\xxxx\AppData\Roaming\npm\node_modules\aurelia-cli\bin\aurelia-   cli.js:3
const resolve = require('../lib/resolve');
^^^^^
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 Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3

Any ideas as to what would be causing this?

PRS
  • 741
  • 1
  • 7
  • 27
  • According to this [post](http://stackoverflow.com/questions/22603078/syntaxerror-use-of-const-in-strict-mode), upgrading node should resolve this issue. – 300 baud Aug 03 '16 at 12:51

2 Answers2

2

Make sure you have a compatible version of Node installed. You can check the your Node version with node -v.

Aurelia CLI is only compatible with Node >= 4.x

You can download a compatible version of Node from here.

Josh Graham
  • 1,188
  • 12
  • 17
  • The node version said v0.12.7, even though I had installed v4.4.7. So I uninstalled and then installed Node v6.3.1, but it still says version v0.12.7 when I do `node -v`. I still get the same error with aurelia-cli. – PRS Aug 03 '16 at 13:20
1

This error was to do with the node version but it was not a process of simply downloading and installing the latest version. I got this working after going through the following steps:

Open the Node command prompt and upgrade the node version with:

npm cache clean
npm update -g

Still in the Node command prompt, go to the relevant directory and run

au new

And it worked fine.

Even after upgrading the node version as above, the version had not changed in the normal windows command prompt and the aurelia cli command still did not work from there. So this problem seems to be to do with node versions, windows, and my setup, rather than with the aurelia cli.

PRS
  • 741
  • 1
  • 7
  • 27