我正在尝试使用 Azure DevOps 管道中的托管 macOS 代理构建 Ionic 框架。我有以下构建步骤。
安装 npm@latest -g (NPM)
安装 -g @ionic/app-scripts@latest --save-dev (NPM)
npm i -g ionic@latest --verbose (Ionic CLI)
构建 ios (Ionic CLI)
但我收到以下错误。
2018-11-15T02:36:25.4788550Z ==============================================================================
2018-11-15T02:36:25.4788690Z Task : Ionic Command
2018-11-15T02:36:25.4788740Z Description : Run an Ionic CLI command
2018-11-15T02:36:25.4788770Z Version : 1.3.12
2018-11-15T02:36:25.4788800Z Author : Microsoft Corporation
2018-11-15T02:36:25.4788900Z Help : [More Information](http://go.microsoft.com/fwlink/?LinkID=692057)
2018-11-15T02:36:25.4788940Z ==============================================================================
2018-11-15T02:36:25.9506080Z Module cache at /Users/vsts/.taco_home/node_modules
2018-11-15T02:36:26.9844280Z cordova already installed.
2018-11-15T02:36:26.9845750Z Cordova Module Path: /Users/vsts/.taco_home/node_modules/cordova/8.1.2/node_modules/cordova
2018-11-15T02:36:26.9849330Z Module cache at /Users/vsts/.taco_home/node_modules
2018-11-15T02:36:27.9211450Z ionic already installed.
2018-11-15T02:36:27.9213230Z Ionic Module Path: /Users/vsts/.taco_home/node_modules/ionic/4.3.1/node_modules/ionic
2018-11-15T02:36:28.4726980Z [WARN] ionic build is for building web assets and takes no arguments. See ionic build --help.
2018-11-15T02:36:28.4727450Z
2018-11-15T02:36:28.4727570Z Ignoring argument ios. Perhaps you meant ionic cordova build ios?
2018-11-15T02:36:28.4727640Z
2018-11-15T02:36:28.5020530Z > ionic-app-scripts build
2018-11-15T02:36:30.8035540Z [02:36:30] ionic-app-scripts 3.2.0
2018-11-15T02:36:30.8054190Z [02:36:30] build dev started ...
2018-11-15T02:36:30.8621960Z [02:36:30] ionic-app-script task: "build"
2018-11-15T02:36:30.8622700Z [02:36:30] Error: ENOENT: no such file or directory, open
2018-11-15T02:36:30.8623700Z '/Users/vsts/agent/2.142.1/work/1/s/MyApp/node_modules/@angular/core/package.json'
2018-11-15T02:36:30.8630180Z Error: ENOENT: no such file or directory, open '/Users/vsts/agent/2.142.1/work/1/s/MyApp/node_modules/@angular/core/package.json'
2018-11-15T02:36:30.8632330Z at Error (native)
2018-11-15T02:36:30.8807840Z [ERROR] An error occurred while running subprocess ionic-app-scripts.
2018-11-15T02:36:30.8808230Z
2018-11-15T02:36:30.8809020Z ionic-app-scripts build exited with exit code 1.
2018-11-15T02:36:30.8809110Z
2018-11-15T02:36:30.8809730Z Re-running this command with the --verbose flag may provide more information.
2018-11-15T02:36:30.9233030Z ##[error]Task failed
2018-11-15T02:36:30.9263660Z ##[section]Finishing: Ionic Command build ios