question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Material not working in new CLI application

See original GitHub issue

Bug, feature request, or proposal:

Bug

What is the expected behavior?

Should launch skeleton app from cli

What is the current behavior?

erroring on ng serve command

image

What are the steps to reproduce?

ng new my-app npm install --save @angular/material

followed every step in this page https://github.com/angular/angular-cli/wiki/stories-include-angular-material

WORKS if i remove MaterialModule from imports in app.module.ts

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { MaterialModule } from '@angular/material';

import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    FormsModule,
    HttpModule,
    // MaterialModule <-- works when removed
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

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

angular 4.3.1 2.0.0-beta.8 windows 7 TS 2.2.1

Is there anything else we should know?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mkarthi1947commented, Apr 20, 2018

Try this way without npm. Its working fine for me.

  1. For the alternative install dependency. Install yarn in your machine. pls check this url https://yarnpkg.com/en/
  2. Install dependency : c:\Users\User\Desktop\material2>yarn install
  3. Run your app: c:\Users\User\Desktop\material2>npm run demo-app
  4. Run url in your browser : _http://localhost:4200/_
  5. Done
0reactions
angular-automatic-lock-bot[bot]commented, Sep 8, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why Angular Material is not being installed in my latest ...
Recently I created a new angular application with latest version of Angular: 13.1.1 and I am trying to install angular Material but I'm ......
Read more >
Angular | IntelliJ IDEA Documentation - JetBrains
The recommended way to start building a new Angular application is Angular CLI, which IntelliJ IDEA downloads and runs for you using npx....
Read more >
CLI Overview and Command Reference - Angular
If the current working directory is not the right place for your project, ... The initial application created by the ng new command...
Read more >
Angular Material Installation - Javatpoint
Install the Angular CLI by using npm: npm install -g @angular/cli ... Create a workspace: ng new angular-material-app ... The add command will...
Read more >
Learn Angular Material - Full Tutorial - YouTube
Learn how to use Angular Material in this full tutorial course for beginners. Angular Material is a UI component library for Angular JS ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found