An error occurred while running subprocess ionic-app-scripts :
[ERROR] ionic-app-scripts has unexpectedly closed (exit code 1). The Ionic CLI will exit. Please check any output above for error details. ionic3-firebase-shopping-cart-master anand$ ionic cordova run android > ionic-app-scripts build --target cordova --platform android /Users/anand/projects/Ionic/ShoppingCart/ionic3-firebase-shopping-cart-master/node_modules/node-sass/lib/binding.js:13 throw new Error(errors.unsupportedEnvironment()); ^ 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: https://github.com/sass/node-sass/releases/tag/v4.5.3 at module.exports (/Users/anand/projects/Ionic/ShoppingCart/ionic3-firebase-shopping-cart-master/node_modules/node-sass/lib/binding.js:13:13) at Object.<anonymous> (/Users/anand/projects/Ionic/ShoppingCart/ionic3-firebase-shopping-cart-master/node_modules/node-sass/lib/index.js:14:35) at Module._compile (internal/modules/cjs/loader.js:678:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10) at Module.load (internal/modules/cjs/loader.js:589:32) at tryModuleLoad (internal/modules/cjs/loader.js:528:12) at Function.Module._load (internal/modules/cjs/loader.js:520:3) at Module.require (internal/modules/cjs/loader.js:626:17) at require (internal/modules/cjs/helpers.js:20:18) at Object.<anonymous> (/Users/anand/projects/Ionic/ShoppingCart/ionic3-firebase-shopping-cart-master/node_modules/@ionic/app-scripts/dist/core/bundle-components.js:6:16) [ERROR] An error occurred while running subprocess ionic-app-scripts. ionic-app-scripts build --target cordova --platform android exited with exit code 1. Re-running this command with the --verbose flag may provide more information.
onic3-firebase-shopping-cart-master anand$ ionic cordova platform rm ios
cordova platform remove ios –save Removing platform ios from config.xml file… ionic3-firebase-shopping-cart-master anand$ ionic cordova run android ionic-app-scripts build –target cordova –platform android /Users/anand/projects/Ionic/ShoppingCart/ionic3-firebase-shopping-cart-master/node_modules/node-sass/lib/binding.js:13 throw new Error(errors.unsupportedEnvironment());
It seems like you are encountering an error related to the node-sass package in your Ionic project. The error message indicates that Node Sass does not support your current environment.
To resolve this issue, you can try the following steps:
- Clear npm cache: Sometimes, the issue can be resolved by clearing the npm cache. Run the following command in your terminal:
npm cache clean --force
- Update Node.js and npm: Ensure that you have the latest version of Node.js and npm installed. You can download the latest version from the official Node.js website.
- Reinstall node-sass: The error may occur due to a corrupted node-sass installation. Try reinstalling node-sass by running the following command:
npm install node-sass
- Check package.json: Make sure that you do not have any conflicting or outdated dependencies in your project’s package.json file. Ensure that node-sass is listed as a dependency.
- Check your environment: If you are using a Node.js version that is not compatible with node-sass, consider switching to a supported version. Check the node-sass GitHub page (https://github. com/sass/node-sass) for compatibility information.
- Use Dart Sass: If node-sass continues to cause issues, consider using Dart Sass, the official Sass compiler. To do this, uninstall node-sass and install Dart Sass:
npm uninstall node-sass
npm install sass
After installing Dart Sass, update your build scripts or configuration to use
sass
instead ofnode-sass
.
Remember to perform these steps in your project’s root directory. Once you have tried these solutions, run ionic cordova run android
again to see if the issue is resolved. If the problem persists, the error details provided in the terminal with the --verbose
flag may help in identifying the root cause.