Angular-cli: Cli not working in OSX Sierra

Created on 10 Feb 2017  路  12Comments  路  Source: angular/angular-cli

OS?

Mac OSX Sierra

Versions.

node -v
v4.2.0
npm -v
3.5.3

Repro steps.

npm install -g angular-cli
ng new my-app

The log given by the failure.

/usr/local/lib/node_modules/angular-cli/node_modules/@ngtools/json-schema/src/schema-class-factory.js:33
            result.push(...indices);
                        ^^^

SyntaxError: Unexpected token ...
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:414:25)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/angular-cli/node_modules/@ngtools/json-schema/src/index.js:2:30)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)

Most helpful comment

Someone already did, and it seems to be fixed on next push: https://github.com/angular/material2/issues/2939

All 12 comments

@vitorreis please look at the prerequisites for the cli. https://github.com/angular/angular-cli#prerequisites. You will need node >= 6.9

also the new package name for the cli is @angular/cli (instead of angular-cli)

Closed as answered by @deebloo

Ok, I will contact the guys from angular material to update their docs: https://material.angular.io/guide/getting-started

And also in the official docs... https://angular.io/docs/ts/latest/cli-quickstart.html

node version outdated

Indeed it's outdated there in the docs. That one is actually on me, I need to go update angular.io as well.

@filipesilva Please also fix/report to angular material docs, I don't know to whom report that error.

Someone already did, and it seems to be fixed on next push: https://github.com/angular/material2/issues/2939

Hi, I have a similar issue with:

result.push(...indices);
                  ^^^
SyntaxError: Unexpected token ...

On older version of angular-cli v1.0.0-beta.26, which doesn't require node v6.x
I don't want to update angular-cli now. Could anyone of you point me to the package which requires node6, so I will downgrade it explicitly in my project?

@KKrisu that would be all the @ngtools/ packages: @ngtools/json-schema, @ngtools/logger and @ngtools/webpack.

The error you get should point you to the right package. For examples:

/usr/local/lib/node_modules/angular-cli/node_modules/@ngtools/json-schema/src/schema-class-factory.js:33
            result.push(...indices);
                        ^^^

Is in @ngtools/json-schema.

Got it, thank you @filipesilva

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings