Skip to content

Problem with Alpha.9-3 installation #1381

Closed

Description

@rafaelss95

I just started a new project and I did everything as is in the GETTING_STARTED.md

After I did npm install --save @angular/material

I got:

angular@0.0.0 /path
├── UNMET PEER DEPENDENCY @angular/common@2.0.0
├── UNMET PEER DEPENDENCY @angular/compiler@2.0.0
├── UNMET PEER DEPENDENCY @angular/core@2.0.0
├── @angular/material@2.0.0-alpha.9-3 
└── UNMET PEER DEPENDENCY @angular/platform-browser@2.0.0

npm WARN @angular/compiler-cli@0.6.3 requires a peer of @angular/compiler@2.0.1 but none was installed.
npm WARN @angular/compiler-cli@0.6.3 requires a peer of @angular/core@2.0.1 but none was installed.
npm WARN @angular/platform-server@2.0.1 requires a peer of @angular/core@2.0.1 but none was installed.
npm WARN @angular/platform-server@2.0.1 requires a peer of @angular/common@2.0.1 but none was installed.
npm WARN @angular/platform-server@2.0.1 requires a peer of @angular/compiler@2.0.1 but none was installed.
npm WARN @angular/platform-server@2.0.1 requires a peer of @angular/platform-browser@2.0.1 but none was installed.

And when I did ng serve I got:

ERROR in [default] /path/node_modules/@angular/material/core/gestures/MdGestureConfig.d.ts:4:39 
Cannot find name 'HammerManager'.

ERROR in [default] /path/node_modules/@angular/material/slide-toggle/slide-toggle.d.ts:68:19 
Cannot find name 'HammerInput'.

ERROR in [default] /path/node_modules/@angular/material/slider/slider.d.ts:61:19 
Cannot find name 'HammerInput'.

ERROR in [default] /path/node_modules/@angular/material/slider/slider.d.ts:63:24 
Cannot find name 'HammerInput'.

I tried to install npm install hammerjs, but it doesn't work also.

Thanks in advance.

Activity

  1. spock123 commented on Sep 30, 2016

    @spock123

    Just a quick question: did you use npm 3?

    I just installed 9-3 without issues (nvm 3, Angular 2.0.1)

  2. slmyers commented on Sep 30, 2016

    @slmyers

    try npm install @types/hammerjs

  3. cre8 commented on Sep 30, 2016

    @cre8

    Restarting the server (ng serve) and adding types helped me.

  4. rafaelss95 commented on Sep 30, 2016

    @rafaelss95
    ContributorAuthor

    @spock123, Yes I'm using the version 3.10.8.

    Well, it's a little bit strange.. first of all I think I don't need add hammerjs since I wasn't using any component yet, and in GETTING_STARTED.md says clearly I just need to add it if I use md-slide-toggle and md-slider. However I installed as I mentioned npm install hammerjs, but it still also gives me error.

    Now the problem is solved using the suggestion given by @slmyers, but why is it necessary? If I'm not even using none of the modules that required hammerjs?

    Also, the UNMMEET PEER DEPENDENCY warning is still here, and I think there's a problem because if I simply add, for example the following:

    <button md-raised-button color="primary">PRIMARY</button>
    <button md-raised-button color="accent">ACCENT</button>
    <button md-raised-button color="warn">WARN</button>
    

    It comes without any style..

  5. spock123 commented on Sep 30, 2016

    @spock123

    @rafaelss95 don't worry about the dependency stuff.. it's just npm3 telling you about them.. it's nothing to worry about afaik...

    I think hammer.js is needed by Material-core now, but I'm not sure about this.. just install it to be sure :)

  6. rafaelss95 commented on Sep 30, 2016

    @rafaelss95
    ContributorAuthor

    Hmm, thanks for all helpful information.

    Can you tell me what's the problem with this simple example:

    <button md-raised-button color="primary">PRIMARY</button>
    <button md-raised-button color="accent">ACCENT</button>
    <button md-raised-button color="warn">WARN</button>
    

    It's displaying without colors.
    Do I need to do something more than it to make it work? In my ts file, for example?

  7. dahaupt commented on Sep 30, 2016

    @dahaupt

    @rafaelss95 I think you have to include a theme or write your own. Check the theming.md in the docs folder for more information.

  8. vinagreti commented on Sep 30, 2016

    @vinagreti
    Contributor

    You can see in this PR #1385 how to use themes to customize your own components.

  9. angular-automatic-lock-bot commented on Sep 5, 2019

    @angular-automatic-lock-bot

    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.

  10. locked and limited conversation to collaborators on Sep 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions