admin管理员组文章数量:1292751
When i tried to run this mand:
ng generate ponent <ponent-name>
I got this error:
Error: Cannot read property 'dasherize' of undefined
Cannot read property 'dasherize' of undefined
My angular config:
Angular CLI: 1.7.1
Node: 7.5.0
OS: darwin x64
Angular: 5.2.6
... animations, mon, piler, piler-cli, core, forms
... http, platform-browser, platform-browser-dynamic
... platform-server, router
@angular/cdk: 5.2.2
@angular/cli: 1.7.1
@angular/material: 5.2.2
@angular-devkit/build-optimizer: 0.4.2
@angular-devkit/core: 0.0.20
@angular-devkit/schematics: 0.0.34
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.10.1
@schematics/angular: 0.3.2
@schematics/package-update: 0.3.2
typescript: 2.6.2
webpack: 3.11.0
I've tried to remove node_modules, npm cache clean, node install and none of that worked.
When i tried to run this mand:
ng generate ponent <ponent-name>
I got this error:
Error: Cannot read property 'dasherize' of undefined
Cannot read property 'dasherize' of undefined
My angular config:
Angular CLI: 1.7.1
Node: 7.5.0
OS: darwin x64
Angular: 5.2.6
... animations, mon, piler, piler-cli, core, forms
... http, platform-browser, platform-browser-dynamic
... platform-server, router
@angular/cdk: 5.2.2
@angular/cli: 1.7.1
@angular/material: 5.2.2
@angular-devkit/build-optimizer: 0.4.2
@angular-devkit/core: 0.0.20
@angular-devkit/schematics: 0.0.34
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.10.1
@schematics/angular: 0.3.2
@schematics/package-update: 0.3.2
typescript: 2.6.2
webpack: 3.11.0
I've tried to remove node_modules, npm cache clean, node install and none of that worked.
Share Improve this question asked Feb 22, 2018 at 15:31 user3516604user3516604 3673 silver badges9 bronze badges 2- 1 github./angular/angular-cli/issues/9662 – R. Richards Commented Feb 22, 2018 at 15:34
- 3 Thank you, I fixed it by updating; @ angular-devkit/core from "0.0.23" to "0.4.2" and @ angular-devkit/schematics from"0.0.42" to "0.4.2" – user3516604 Commented Feb 22, 2018 at 15:54
4 Answers
Reset to default 8If you simply need to use the @Angular/Cli
in your project without the extended features provided by all the libraries of Angular DevKit (described here).
In your package.json
you can simply set inside your devDependencies
"@angular-devkit/core":"0.4.6"
ignoring other libraries like schematics
and package-update
which you can remove entirely.
In this way, you can use shortcuts aliases without problems like this one to create new ponents
ng g c my-new-ponent
Tested with "@angular/cli": "1.7.3"
Uninstalled the existing packages @angular-devkit/core
and @angular-devkit/schematics
and installed the latest helped me
npm uninstall @angular-devkit/core
npm uninstall @angular-devkit/schematics
then install the latest
npm install @angular-devkit/core --save-dev
npm install @angular-devkit/schematics --save-dev
I had the same issue. I updated the package @angular-devkit/schematics
to the latest one and it started working.
Hope this will resolve your issue as well.
Helpful code snippet :
"@angular-devkit/core": "^0.6.8",
"@angular-devkit/schematics": "^0.6.8",
"@angular/cli": "^1.7.4",
"@angular/piler-cli": "^5.1.1",
本文标签: javascriptCannot read property 39dasherize39 of undefinedStack Overflow
版权声明:本文标题:javascript - Cannot read property 'dasherize' of undefined - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741562761a2385542.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论