PRS
PRS

Reputation: 761

Error when running 'au new' for Aurelia cli tool

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?

Upvotes: 3

Views: 2266

Answers (2)

PRS
PRS

Reputation: 761

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.

Upvotes: 1

Josh Graham
Josh Graham

Reputation: 1208

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.

Upvotes: 2

Related Questions