我正在尝试在 Angular 6 项目上设置 Angular Material。但是,当尝试运行时:
ng generate @angular/material:material-nav --project=ui-project
我收到以下错误消息:
Cannot read property 'replace' of undefined
这是我的 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"
}
}
我正在运行以下命令: Angular CLI:6.2.1 节点:10.9.0 操作系统:darwin x64 Angular:6.1.7