簡體   English   中英

Angular-Cli'ng g c my-new-component'錯誤:無法找到(未定義)且無法找到(未定義)

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM