An error occurred while running subprocess ionic-app-scripts. ionic-app-scripts build exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
Solution -
This is due to the latest version of ionic and Cordova in your system but your project does not support this version.
Run below command in your project -
ionic info
Below is the above command result -
cli packages: (/usr/local/lib/node_modules)
@ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
global packages:
cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
local packages:
@ionic/app-scripts : 1.3.0
Cordova Platforms : android 6.3.0 ios 4.3.1
Ionic Framework : ionic-angular 3.0.1
System:
Node : v10.14.2
npm : 6.4.1
OS : macOS High Sierra
Here as we can see Ionic CLI version is “3.20.0” so we need to update CLI version to this, Then I can build the project without error.
To update CLI version please run below command -
npm i -g ionic@3.20.0
Above command result is -
npm i -g ionic@3.20.0
npm WARN deprecated @ionic/cli-utils@1.19.2: Latest Ionic CLI does not use this package.
/usr/local/bin/ionic -> /usr/local/lib/node_modules/ ionic/bin/ionic
> fsevents@1.2.4 install /usr/local/lib/node_modules/ ionic/node_modules/fsevents
> node install
[fsevents] Success: "/usr/local/lib/node_modules/ ionic/node_modules/fsevents/ lib/binding/Release/node-v64- darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
+ ionic@3.20.0
added 323 packages from 157 contributors, removed 106 packages, updated 23 packages and moved 5 packages in 20.135s
Now update Cordova for this by using below command -
npm install -g cordova
Above command result is -
/usr/local/bin/cordova -> /usr/local/lib/node_modules/ cordova/bin/cordova
+ cordova@8.1.2
updated 1 package in 3.948s
Now again try to build your project by using below command-
ionic cordova build ios
This should work but if you are getting below error -
Error: Node Sass does not yet support your current environment: OS X 64-bit with Unsupported runtime (64)
For more information on which environments are supported please see:
Run below command in your project -
npm rebuild node-sass
Above command will resolve the issue related to Node Sass.
If you still having this issue, Check your Node version. In my case node version was “v6.14.1” So when I update none version to “v6.14.1” and run again this command.
You can check all released version of node on below URL -
Now after updating version run below command in your project -
ionic cordova build ios
Now in my case above command build the project successfully. Please try in your project and post a comment if you still have any issue to build the project.
No comments:
Post a Comment