angular / components

Component infrastructure and Material Design components for Angular
https://material.angular.io
MIT License
24.33k stars 6.73k forks source link

build: Cannot find module '@angular/animations' #3760

Closed ericgundrum closed 7 years ago

ericgundrum commented 7 years ago

Bug, feature request, or proposal:

bug

What is the expected behavior?

npm install --save https://github.com/angular/material2-builds.git in a new project should build.

What is the current behavior?

npm install --save https://github.com/angular/material2-builds.git in a new project fails to build reporting error Cannot find module '@angular/animations'.

What are the steps to reproduce?

ng new tst
cd tst
npm install
npm install --save https://github.com/angular/material2-builds.git

Then add MaterialModule to app.module.ts (as in Getting started) and ng build.

Which versions of Angular, Material, OS, browsers are affected?

node v7.7.4 @angular/cli v1.0.0 https://github.com/angular/material2-builds.git#6f8753ca3464d1167b6f582ae2ac17ec563ab8f4

Is there anything else we should know?

There is no reference to @angular/animations in https://github.com/angular/material2-builds/blob/master/package.json

Nikki1993 commented 7 years ago

You need to install manually @angular/animations it's now a separate package. Read the full announcement here http://angularjs.blogspot.com/2017/03/angular-400-now-available.html

ericgundrum commented 7 years ago

@Nikki1993, that's helpful. I see that running npm install '@angular/animations' fixes the build problem.

Possibly the Material project should address this in a less obscure way. Maybe animations should be listed as a peer dependency. Or maybe Getting started should be updated to indicate the step to install it. Or maybe both are needed.

Nikki1993 commented 7 years ago

@ericgundrum change happened literally today with the upgrade to Angular v4. Prior versions are unaffected by it thus they couldn't list it as peer dependency. They still need to merge the commit that makes material angular 4 compatible & update the docs. Be patient.

jelbourn commented 7 years ago

This is expected as master has moved to Angular 4. When we have our next release there will be instructions for the new setup.

Also, be careful using the snapshots on material2-builds; they can break at any time (like right now as we're in the middle of changing our package structure).

angular-automatic-lock-bot[bot] commented 5 years ago

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.