使用Angular2,在項目文件夾移動後,我得到了這個錯誤,而試圖建立通過CLI新組件創建新的組件,我要去發佈的所有終端的消息:Angular2:錯誤,同時通過CLI
edoardocanti$ ng generate component other
Could not start watchman; falling back to NodeWatcher for file system
events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
installing component
create src/app/other/other.component.css
create src/app/other/other.component.html
create src/app/other/other.component.spec.ts
create src/app/other/other.component.ts
Cannot read property 'read' of undefined
TypeError: Cannot read property 'read' of undefined
at InsertChange.apply (/Users/edoardocanti/first-
app/node_modules/@angular-cli/ast-tools/src/change.js:96:20)
at /Users/edoardocanti/first-app/node_modules/@angular-cli/ast-
tools/src/change.js:71:61
at process._tickCallback (internal/process/next_tick.js:103:7)
它創建我的新組件的文件夾,但我必須手動添加它在app.module.ts,但是它的工作原理。
真正的問題是,當我嘗試在現有文件夾內創建新組件時,在這種情況下,Angular不會創建任何新組件。
我也被這個咬了,然而同樣版本的angular-cli對我的另一個項目很好,幾天前創建 – user776686