12

I am getting below error while i run ionic project: I'm getting an error when building an Ionic 3 app 1

[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.

ionic3-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());

1
  • 1
    For me remove node_modules folder and then run npm install works. Commented Feb 24, 2019 at 10:19

5 Answers 5

14

After a long try I resolved this with below command:

npm install @ionic/app-scripts@latest --save-dev

And it worked.

Also if not working then try to downgrade the app-script dependency in package.json as below:

From

"@ionic/app-scripts": "3.2.4"

to

"@ionic/app-scripts": "3.2.3"

Hope it will help someone

Sign up to request clarification or add additional context in comments.

1 Comment

Also please check your dependencies in package.json file. It generally comes because of dependencies mismatch.
9

Delete the entire node_modules folder in your project and then run this command :

npm install @ionic/app-scripts@latest --save-dev

It will work just fine.

1 Comment

Just delete node_modules\@ionic\app-scripts and execute the command
1

Got the same problem (node v10.3.0, ionic 3.13.0). This worked :

Delete package-lock.json,

Delete node_modules folder,

Run npm install again.

Comments

1

some files was deleted or hidden

Comments

0

For me, the issue was the latest app-scripts version. I downgraded by changing

"@ionic/app-scripts": "3.2.4"

in package.json to

"@ionic/app-scripts": "3.2.3"

and running

npm install

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.