ng add @angular/material
Angular CLI: 6.0.0-rc.5 Node: 8.11.0 OS: darwin x64 Angular: 6.0.0-rc.5
when try to add angular material with commande : ng add @angular/material
i get this error :

any idea ?
You need to install the packages first:
npm install --save angular/material2-builds@next angular/cdk-builds@next
then
ng add @angular/material
@MRMokwa thank you for but i get this error when try to install packages :

Do you mind trying a new project from zero?
ng n teste-app cd teste-app npm install --save @angular/material@next @angular/cdk@next ng add @angular/material
Result I expect:

My versions:

@MRMokwa When I try doing that, I only get a "Cannot read property 'includes' of undefined" message.

My versions:

Could the different node versions be the cause of this issue?
Edit: nevermind, the same happens after I updated to node 9.11.1
Hi @MRMokwa, i follow your instructions and i creat another new app and this a result:

i guess my be need to update node version too ?
I just downgraded my Node and it still working as expected for me.

Really weird issue, don't know what's causing it.
My full version if you want to compare:

I'm having the same issue.
Here is my full version

And when I run ng add @angular/material

Edit: also tested in Node 9.11.1 same result
I'm getting the same issue. On a new project:

These are my versions:

I've updated material and cdk to rc.12 and I'm now having the same issue as @cduran
This should be managed by the material team as its part of their schematics; its not a CLI issue. I had already logged the issue at https://github.com/angular/material2/issues/10912. @kamalkech you might want to close this one.
@tobi-or-not-tobi ok!
@tobi-or-not-tobi fixed when you update angular cli to rc.7
Thanks @kamalkech, I'm unfortunately blocked by #10513.
@kamalkech But works fine when I update an existing project. Thanks for the heads-up.
with cli6 this works:
ng new x cd x ng add @angular/material@^6.0.0
No docs on schematics tho as seen in ngconf :( (and even docs for ng add are missing from the cli wiki)
edit: https://github.com/angular/material2/blob/6.0.x/guides/schematics.md :)
Worked by updating npm for me. npm version 6.1.0
Try running npm i -g npm
When i do:
npm install --save @angular/material @angular/cdk
it installs below:
- @angular/[email protected]
- @angular/[email protected]
Then, as per above solutions:
I do:
ng add @angular/material
it throws as below:
Installing packages for tooling via npm. Cannot read property 'startTag' of undefined
NPM Version: 6.1.0 Angular CLI: 6.0.8 Node: 8.11.3 OS: darwin x64 Angular: 6.0.7
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.