2018-11-06Angular cli 创建组件时 报错

2018-11-06  本文已影响0人  考拉狸猫

Angular cli 创建组件时 报错

Local workspace file ('angular.json') could not be found.
Error: Local workspace file ('angular.json') could not be found.
    at WorkspaceLoader._getProjectWorkspaceFilePath (C:\Users\THINK\AppData\Roam
ing\npm\node_modules\@angular\cli\models\workspace-loader.js:44:19)
    at WorkspaceLoader.loadWorkspace (C:\Users\THINK\AppData\Roaming\npm\node_mo
dules\@angular\cli\models\workspace-loader.js:31:21)
    at GenerateCommand._loadWorkspace (C:\Users\THINK\AppData\Roaming\npm\node_m
odules\@angular\cli\models\schematic-command.js:328:29)
    at GenerateCommand.<anonymous> (C:\Users\THINK\AppData\Roaming\npm\node_modu
les\@angular\cli\models\schematic-command.js:63:18)
    at Generator.next (<anonymous>)
    at C:\Users\THINK\AppData\Roaming\npm\node_modules\@angular\cli\models\schem
atic-command.js:14:71
    at new Promise (<anonymous>)
    at __awaiter (C:\Users\THINK\AppData\Roaming\npm\node_modules\@angular\cli\m
odels\schematic-command.js:10:12)
    at GenerateCommand.initialize (C:\Users\THINK\AppData\Roaming\npm\node_modul
es\@angular\cli\models\schematic-command.js:62:16)
    at GenerateCommand.<anonymous> (C:\Users\THINK\AppData\Roaming\npm\node_modu
les\@angular\cli\commands\generate-impl.js:33:40)

原因:缺少angular.json
解决:创建一个新的项目,然后把angular.json文件复制进去

上一篇下一篇

猜你喜欢

热点阅读