[英]Angular-Cli 'ng g c my-new-component' Error: Could not find (undefined) and Could not find (undefined)
问题:
在我的angular 5+应用程序项目中,在我的一个子文件夹中,在输入ng gc my-component
,没有生成,而是弹出一些未知错误,任何人都知道这里发生了什么? 我已经多次重新安装了npm / angular @ cli。
jocs@Jocs ~/r/s/a/pages (devReno)> ng g c my-new-component
Error: Could not find (undefined)
Could not find (undefined)
jocs@Jocs ~/r/s/a/pages (devReno) [1]> ng generate component my-new-component
Error: Could not find (undefined)
Could not find (undefined)
jocs@Jocs ~/r/s/a/pages (devReno) [1]>
开发环境:
操作系统:darwin x64(Mac OS:10.13.4)
Angular CLI:1.7.4
节点:9.11.1
Angular:5.2.9
我有这个问题,我不得不重新安装Angular Cli。
我重新安装的方式是降级然后再升级。 我想你也可以从node_modules
删除包或者执行npm uninstall @angular/cli
然后npm i @angular/cli@1.7.4
。
对我有用的方法是这样做:
如果我安装了不同的版本$ npm i @angular/cli@1.7.3
我的npm版本(版本6.0)将降级角度cli
然后我升级回1.7.4 $ npm i @angular/cli@1.7.4
我的问题是我在根目录中有文件和节点目录。 我删除它。
rm -rf node_modules/
rm package-lock.json
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.