Unable to run ng generate @angular/material:material-nav











up vote
1
down vote

favorite












I am trying to setup Angular Material on an Angular 6 project. However, When attempting to run:



ng generate @angular/material:material-nav --project=ui-project


I get the following error message:



Cannot read property 'replace' of undefined


Here is my package.json



{
"name": "ui-project",
"version": "0.0.0",
"license": "MIT",
"angular-cli": {},
"scripts": {
"ng": "ng",
"start": "ng serve",
"test": "ng test",
"pree2e": "webdriver-manager update --standalone false --gecko false",
"e2e": "protractor"
},
"private": true,
"dependencies": {
"@angular-devkit/schematics": "^0.8.1",
"@angular/cdk": "^6.2.1",
"@angular/common": "^6.1.7",
"@angular/compiler": "^6.1.7",
"@angular/core": "^6.1.7",
"@angular/forms": "^6.1.7",
"@angular/http": "^6.1.7",
"@angular/material": "^6.4.7",
"@angular/platform-browser": "^6.1.7",
"@angular/platform-browser-dynamic": "^6.1.7",
"@angular/router": "^6.1.7",
"core-js": "^2.4.1",
"help": "^3.0.2",
"parse5": "^5.1.0",
"rxjs": "^6.3.2",
"ts-helpers": "^1.1.1",
"zone.js": "^0.8.26",
"@angular/animations": "^6.0.0"
},
"devDependencies": {
"@types/jasmine": "2.8.8",
"@types/node": "^10.9.4",
"codelyzer": "~4.4.4",
"jasmine-core": "3.2.1",
"jasmine-spec-reporter": "4.2.1",
"karma": "3.0.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-remap-istanbul": "^0.6.0",
"protractor": "~5.4.0",
"ts-node": "7.0.1",
"tslint": "^5.11.0",
"typescript": "~3.0.3",
"webpack": "^4.17.2"
}
}


I am running the following:
Angular CLI: 6.2.1
Node: 10.9.0
OS: darwin x64
Angular: 6.1.7










share|improve this question






















  • may be this article will help you github.com/angular/material2/issues/11504
    – pradip shinde
    Sep 7 at 5:39

















up vote
1
down vote

favorite












I am trying to setup Angular Material on an Angular 6 project. However, When attempting to run:



ng generate @angular/material:material-nav --project=ui-project


I get the following error message:



Cannot read property 'replace' of undefined


Here is my package.json



{
"name": "ui-project",
"version": "0.0.0",
"license": "MIT",
"angular-cli": {},
"scripts": {
"ng": "ng",
"start": "ng serve",
"test": "ng test",
"pree2e": "webdriver-manager update --standalone false --gecko false",
"e2e": "protractor"
},
"private": true,
"dependencies": {
"@angular-devkit/schematics": "^0.8.1",
"@angular/cdk": "^6.2.1",
"@angular/common": "^6.1.7",
"@angular/compiler": "^6.1.7",
"@angular/core": "^6.1.7",
"@angular/forms": "^6.1.7",
"@angular/http": "^6.1.7",
"@angular/material": "^6.4.7",
"@angular/platform-browser": "^6.1.7",
"@angular/platform-browser-dynamic": "^6.1.7",
"@angular/router": "^6.1.7",
"core-js": "^2.4.1",
"help": "^3.0.2",
"parse5": "^5.1.0",
"rxjs": "^6.3.2",
"ts-helpers": "^1.1.1",
"zone.js": "^0.8.26",
"@angular/animations": "^6.0.0"
},
"devDependencies": {
"@types/jasmine": "2.8.8",
"@types/node": "^10.9.4",
"codelyzer": "~4.4.4",
"jasmine-core": "3.2.1",
"jasmine-spec-reporter": "4.2.1",
"karma": "3.0.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-remap-istanbul": "^0.6.0",
"protractor": "~5.4.0",
"ts-node": "7.0.1",
"tslint": "^5.11.0",
"typescript": "~3.0.3",
"webpack": "^4.17.2"
}
}


I am running the following:
Angular CLI: 6.2.1
Node: 10.9.0
OS: darwin x64
Angular: 6.1.7










share|improve this question






















  • may be this article will help you github.com/angular/material2/issues/11504
    – pradip shinde
    Sep 7 at 5:39















up vote
1
down vote

favorite









up vote
1
down vote

favorite











I am trying to setup Angular Material on an Angular 6 project. However, When attempting to run:



ng generate @angular/material:material-nav --project=ui-project


I get the following error message:



Cannot read property 'replace' of undefined


Here is my package.json



{
"name": "ui-project",
"version": "0.0.0",
"license": "MIT",
"angular-cli": {},
"scripts": {
"ng": "ng",
"start": "ng serve",
"test": "ng test",
"pree2e": "webdriver-manager update --standalone false --gecko false",
"e2e": "protractor"
},
"private": true,
"dependencies": {
"@angular-devkit/schematics": "^0.8.1",
"@angular/cdk": "^6.2.1",
"@angular/common": "^6.1.7",
"@angular/compiler": "^6.1.7",
"@angular/core": "^6.1.7",
"@angular/forms": "^6.1.7",
"@angular/http": "^6.1.7",
"@angular/material": "^6.4.7",
"@angular/platform-browser": "^6.1.7",
"@angular/platform-browser-dynamic": "^6.1.7",
"@angular/router": "^6.1.7",
"core-js": "^2.4.1",
"help": "^3.0.2",
"parse5": "^5.1.0",
"rxjs": "^6.3.2",
"ts-helpers": "^1.1.1",
"zone.js": "^0.8.26",
"@angular/animations": "^6.0.0"
},
"devDependencies": {
"@types/jasmine": "2.8.8",
"@types/node": "^10.9.4",
"codelyzer": "~4.4.4",
"jasmine-core": "3.2.1",
"jasmine-spec-reporter": "4.2.1",
"karma": "3.0.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-remap-istanbul": "^0.6.0",
"protractor": "~5.4.0",
"ts-node": "7.0.1",
"tslint": "^5.11.0",
"typescript": "~3.0.3",
"webpack": "^4.17.2"
}
}


I am running the following:
Angular CLI: 6.2.1
Node: 10.9.0
OS: darwin x64
Angular: 6.1.7










share|improve this question













I am trying to setup Angular Material on an Angular 6 project. However, When attempting to run:



ng generate @angular/material:material-nav --project=ui-project


I get the following error message:



Cannot read property 'replace' of undefined


Here is my package.json



{
"name": "ui-project",
"version": "0.0.0",
"license": "MIT",
"angular-cli": {},
"scripts": {
"ng": "ng",
"start": "ng serve",
"test": "ng test",
"pree2e": "webdriver-manager update --standalone false --gecko false",
"e2e": "protractor"
},
"private": true,
"dependencies": {
"@angular-devkit/schematics": "^0.8.1",
"@angular/cdk": "^6.2.1",
"@angular/common": "^6.1.7",
"@angular/compiler": "^6.1.7",
"@angular/core": "^6.1.7",
"@angular/forms": "^6.1.7",
"@angular/http": "^6.1.7",
"@angular/material": "^6.4.7",
"@angular/platform-browser": "^6.1.7",
"@angular/platform-browser-dynamic": "^6.1.7",
"@angular/router": "^6.1.7",
"core-js": "^2.4.1",
"help": "^3.0.2",
"parse5": "^5.1.0",
"rxjs": "^6.3.2",
"ts-helpers": "^1.1.1",
"zone.js": "^0.8.26",
"@angular/animations": "^6.0.0"
},
"devDependencies": {
"@types/jasmine": "2.8.8",
"@types/node": "^10.9.4",
"codelyzer": "~4.4.4",
"jasmine-core": "3.2.1",
"jasmine-spec-reporter": "4.2.1",
"karma": "3.0.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-remap-istanbul": "^0.6.0",
"protractor": "~5.4.0",
"ts-node": "7.0.1",
"tslint": "^5.11.0",
"typescript": "~3.0.3",
"webpack": "^4.17.2"
}
}


I am running the following:
Angular CLI: 6.2.1
Node: 10.9.0
OS: darwin x64
Angular: 6.1.7







angular angular-cli angular-material-6






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Sep 7 at 3:44







user2932053



















  • may be this article will help you github.com/angular/material2/issues/11504
    – pradip shinde
    Sep 7 at 5:39




















  • may be this article will help you github.com/angular/material2/issues/11504
    – pradip shinde
    Sep 7 at 5:39


















may be this article will help you github.com/angular/material2/issues/11504
– pradip shinde
Sep 7 at 5:39






may be this article will help you github.com/angular/material2/issues/11504
– pradip shinde
Sep 7 at 5:39














1 Answer
1






active

oldest

votes

















up vote
0
down vote













After a few weeks, and redoing the entire angular project object, I ended up having to upgrade the cli to version 7. Using the ng update -all command updated all the dependancies to the correct version and this worked fine.



Here is the result



Package                      Version
------------------------------------------------------
@angular-devkit/architect 0.10.2
@angular-devkit/core 7.0.2
@angular-devkit/schematics 7.0.2
@schematics/angular 7.0.2
@schematics/update 0.10.2
rxjs 6.3.3
typescript 3.1.3





share|improve this answer























  • to what version? Does it work to the question?
    – E.Coms
    Nov 10 at 17:14











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52214957%2funable-to-run-ng-generate-angular-materialmaterial-nav%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown
























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













After a few weeks, and redoing the entire angular project object, I ended up having to upgrade the cli to version 7. Using the ng update -all command updated all the dependancies to the correct version and this worked fine.



Here is the result



Package                      Version
------------------------------------------------------
@angular-devkit/architect 0.10.2
@angular-devkit/core 7.0.2
@angular-devkit/schematics 7.0.2
@schematics/angular 7.0.2
@schematics/update 0.10.2
rxjs 6.3.3
typescript 3.1.3





share|improve this answer























  • to what version? Does it work to the question?
    – E.Coms
    Nov 10 at 17:14















up vote
0
down vote













After a few weeks, and redoing the entire angular project object, I ended up having to upgrade the cli to version 7. Using the ng update -all command updated all the dependancies to the correct version and this worked fine.



Here is the result



Package                      Version
------------------------------------------------------
@angular-devkit/architect 0.10.2
@angular-devkit/core 7.0.2
@angular-devkit/schematics 7.0.2
@schematics/angular 7.0.2
@schematics/update 0.10.2
rxjs 6.3.3
typescript 3.1.3





share|improve this answer























  • to what version? Does it work to the question?
    – E.Coms
    Nov 10 at 17:14













up vote
0
down vote










up vote
0
down vote









After a few weeks, and redoing the entire angular project object, I ended up having to upgrade the cli to version 7. Using the ng update -all command updated all the dependancies to the correct version and this worked fine.



Here is the result



Package                      Version
------------------------------------------------------
@angular-devkit/architect 0.10.2
@angular-devkit/core 7.0.2
@angular-devkit/schematics 7.0.2
@schematics/angular 7.0.2
@schematics/update 0.10.2
rxjs 6.3.3
typescript 3.1.3





share|improve this answer














After a few weeks, and redoing the entire angular project object, I ended up having to upgrade the cli to version 7. Using the ng update -all command updated all the dependancies to the correct version and this worked fine.



Here is the result



Package                      Version
------------------------------------------------------
@angular-devkit/architect 0.10.2
@angular-devkit/core 7.0.2
@angular-devkit/schematics 7.0.2
@schematics/angular 7.0.2
@schematics/update 0.10.2
rxjs 6.3.3
typescript 3.1.3






share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 11 at 4:43

























answered Nov 10 at 16:51









thxmike

86




86












  • to what version? Does it work to the question?
    – E.Coms
    Nov 10 at 17:14


















  • to what version? Does it work to the question?
    – E.Coms
    Nov 10 at 17:14
















to what version? Does it work to the question?
– E.Coms
Nov 10 at 17:14




to what version? Does it work to the question?
– E.Coms
Nov 10 at 17:14


















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52214957%2funable-to-run-ng-generate-angular-materialmaterial-nav%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Full-time equivalent

Bicuculline

さくらももこ