我正在尝试在我的 Mac 上运行 ionic 应用程序。当我运行 npm install 来安装依赖项时,一切正常,没有任何问题。 但是当我运行 ionicserve 或 ionics 时,我收到此错误
[ng] Workspace extension with invalid name (defaultProject) found.
[ng] ****************************************************************************************
[ng] This is a simple server for use in testing or debugging Angular applications locally.
[ng] It hasn't been reviewed for security issues.
[ng]
[ng] DON'T USE IT FOR PRODUCTION!
[ng] ****************************************************************************************
[ng] An unhandled exception occurred: readConfiguration is not a function
[ng] See "/private/tmp/ng-Ba9mkz/angular-errors.log" for further details.
[ERROR] ng has unexpectedly closed (exit code 127).
当我搜索这个错误时,我发现了一些与运行相同的解决方案
npm install @ionic/app-scripts@latest --save-dev
但是当我运行这个命令时我也得到了很多错误,这些错误主要与python相关,但是我已经安装了python
从 angular.json 文件中删除 defaultProject(如果存在)。
defaultProject 已被弃用。 请参阅https://github.com/angular/angular-cli/issues/11111