# Ionic 2 build faill

**URL:** <https://forum.ionicframework.com/t/ionic-2-build-faill/67872>\
**Category:** ionic-v3\
**Created:** [October 22, 2016, 12:26pm UTC](https://forum.ionicframework.com/t/ionic-2-build-faill/67872 "2016-10-22T12:26:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rickdana](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rickdana/32/107112_2.png) [@rickdana](https://forum.ionicframework.com/u/rickdana)\
**Post date:** [October 22, 2016, 12:26pm UTC](https://forum.ionicframework.com/t/ionic-2-build-faill/67872/1 "2016-10-22T12:26:49Z")

</div>

Hello,  
I’m trying to build a my project. When i run

> ionic build /

I get the following output.

> node\_modules/@angular/compiler-cli/src/private\_import\_compiler.js:10  
> [12:23:09] exports.AssetUrl = compiler\_1. **compiler\_private**.AssetUrl;  
> [12:23:09] TypeError: Cannot read property ‘AssetUrl’ of undefined  
> [12:23:09] ngc failed  
> [12:23:09] ionic-app-script task: “build”  
> [12:23:09] Error: Error

here is my package.json content:

> “dependencies”: {  
> “@angular/common”: “^2.0.0”,  
> “@angular/compiler”: “^2.1.0”,  
> “@angular/compiler-cli”: “^0.6.2”,  
> “@angular/core”: “^2.1.0”,  
> “@angular/forms”: “^2.0.0”,  
> “@angular/http”: “^2.0.0”,  
> “@angular/platform-browser”: “^2.0.0”,  
> “@angular/platform-browser-dynamic”: “^2.0.0”,  
> “@angular/platform-server”: “^2.1.0”,  
> “@ionic/storage”: “^1.0.3”,  
> “angular2-google-map-auto-complete”: “^2.0.1”,  
> “ionic-angular”: “^2.0.0-rc.1”,  
> “ionic-native”: “^2.0.3”,  
> “ionicons”: “^3.0.0”,  
> “rxjs”: “^5.0.0-rc.1”,  
> “zone.js”: “^0.6.21”  
> },  
> “devDependencies”: {  
> “@ionic/app-scripts”: “latest”,  
> “typescript”: “^2.0.3”  
> },  
> “description”: “occazstreetV2: An Ionic project”,  
> “cordovaPlugins”: [  
> “cordova-plugin-whitelist”,  
> “cordova-plugin-console”,  
> “cordova-plugin-device”,  
> “cordova-plugin-statusbar”,  
> “ionic-plugin-keyboard”,  
> “cordova-plugin-splashscreen”,  
> “cordova-plugin-x-socialsharing”  
> ],  
> “cordovaPlatforms”: [  
> {  
> “platform”: “android”,  
> “version”: “”,  
> “locator”: “android”  
> }  
> ]

can someOne help me to troubleshoot this error?

thks

---

<div class="post-metadata">

**Author:** ![tkem](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/tkem/32/74135_2.png) [@tkem](https://forum.ionicframework.com/u/tkem)\
**Post date:** [October 22, 2016, 12:58pm UTC](https://forum.ionicframework.com/t/ionic-2-build-faill/67872/2 "2016-10-22T12:58:24Z")

</div>

Had the same issue when trying to build a project from scratch that built without error _yesterday_…

Managed to fix this by explicitly pinning down dependencies to the versions I had in a working copy:

[https://github.com/tkem/openlap/blob/master/package.json](https://github.com/tkem/openlap/blob/master/package.json)

---

<div class="post-metadata">

**Author:** ![tkem](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/tkem/32/74135_2.png) [@tkem](https://forum.ionicframework.com/u/tkem)\
**Post date:** [October 22, 2016, 12:59pm UTC](https://forum.ionicframework.com/t/ionic-2-build-faill/67872/3 "2016-10-22T12:59:49Z")

</div>

See also [Ionic 2 rollup git clone error namespace conflict](https://forum.ionicframework.com/t/ionic-2-rollup-git-clone-error-namespace-conflict/67844)

---

<div class="post-metadata">

**Author:** ![pythic](https://avatars.discourse-cdn.com/v4/letter/p/e9c0ed/32.png) [@pythic](https://forum.ionicframework.com/u/pythic)\
**Post date:** [October 22, 2016, 1:39pm UTC](https://forum.ionicframework.com/t/ionic-2-build-faill/67872/4 "2016-10-22T13:39:41Z")

</div>

Fixed it for me, thank you

---

<div class="post-metadata">

**Author:** ![idistech](https://avatars.discourse-cdn.com/v4/letter/i/85e7bf/32.png) [@idistech](https://forum.ionicframework.com/u/idistech)\
**Post date:** [October 22, 2016, 5:29pm UTC](https://forum.ionicframework.com/t/ionic-2-build-faill/67872/5 "2016-10-22T17:29:00Z")

</div>

Okay, this worked for me too…  
Just to confirm , I set as follows…

```
  "scripts": {
    "build": "ionic-app-scripts build",
    "watch": "ionic-app-scripts watch",
    "serve:before": "watch",
    "emulate:before": "build",
    "deploy:before": "build",
    "build:before": "build",
    "run:before": "build"
  },
  "dependencies": {
    "@angular/common": "2.1.0",
    "@angular/compiler": "2.1.0",
    "@angular/compiler-cli": "0.6.2",
    "@angular/core": "2.1.0",
    "@angular/forms": "2.1.0",
    "@angular/http": "2.1.0",
    "@angular/platform-browser": "2.1.0",
    "@angular/platform-browser-dynamic": "2.1.0",
    "@angular/platform-server": "2.1.0",
    "@ionic/storage": "1.0.3",
    "ionic-angular": "2.0.0-rc.1",
    "ionic-native": "2.2.3",
    "ionicons": "^3.0.0",
    "rxjs": "5.0.0-beta.12",
    "tsd": "0.6.5",
    "typings": "1.4.0",
    "underscore": "^1.8.3",
    "zone.js": "0.6.25"
  },
  "devDependencies": {
    "@ionic/app-scripts": "0.0.36",
    "typescript": "^2.0.3"
  },
  "cordovaPlugins": [

```

Thanks to all !

---

<div class="post-metadata">

**Author:** ![Arcen](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@Arcen](https://forum.ionicframework.com/u/Arcen)\
**Post date:** [October 22, 2016, 7:18pm UTC](https://forum.ionicframework.com/t/ionic-2-build-faill/67872/6 "2016-10-22T19:18:18Z")

</div>

nice! had same issue of seeing all the yellow text stating name space conflicts. Locking each version by removing carrot worked!

---

<div class="post-metadata">

**Author:** ![PaijoRX](https://avatars.discourse-cdn.com/v4/letter/p/dec6dc/32.png) [@PaijoRX](https://forum.ionicframework.com/u/PaijoRX)\
**Post date:** [November 4, 2016, 3:31am UTC](https://forum.ionicframework.com/t/ionic-2-build-faill/67872/7 "2016-11-04T03:31:26Z")

</div>

i still got error, bellow our configuration and error logs:

version :

```auto
npm 3.10.3
Cordova CLI: 6.3.1
Ionic Framework Version: 2.0.0-rc.1-201611031834
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.0.0-beta.20
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Mac OS X Yosemite
Node Version: v6.9.1
Xcode version: Xcode 7.2.1 Build version 7C1002

```

package.json

```auto
{
  "name": "bla-bla",
  "author": "blabla",
  "homepage": "http://blabla.com",
  "private": true,
  "scripts": {
    "build": "ionic-app-scripts build",
    "watch": "ionic-app-scripts watch",
    "serve:before": "watch",
    "emulate:before": "build",
    "deploy:before": "build",
    "build:before": "build",
    "run:before": "build"
  },
  "dependencies": {
    "@angular/common": "2.1.0",
    "@angular/compiler": "2.1.0",
    "@angular/compiler-cli": "0.6.2",
    "@angular/core": "2.1.0",
    "@angular/forms": "2.1.0",
    "@angular/http": "2.1.0",
    "@angular/platform-browser": "2.1.0",
    "@angular/platform-browser-dynamic": "2.1.0",
    "@angular/platform-server": "2.1.0",
    "@ionic/storage": "1.0.3",
    "ionic-angular": "2.0.0-rc.1",
    "ionic-native": "2.2.3",
    "ionicons": "3.0.0",
    "rxjs": "5.0.0-beta.12",
    "zone.js": "0.6.25"
  },
  "devDependencies": {
    "@ionic/app-scripts": "0.0.36",
    "typescript": "2.0.3"
  },
  "description": "Bla bla bla",
  "cordovaPlugins": [
    "cordova-plugin-device",
    "cordova-plugin-console",
    "cordova-plugin-whitelist",
    "cordova-plugin-splashscreen",
    "cordova-plugin-statusbar",
    "ionic-plugin-keyboard"
  ],
  "cordovaPlatforms": []
}

```

logs

```auto
Names-MBP:blabla name$ ionic run android

Running 'run:before' npm script before run
> blabla@ build /Users/name/Documents/workspace/ionic/blabla
> ionic-app-scripts build
[10:21:10] ionic-app-scripts 0.0.34 
[10:21:10] build prod started ... 
[10:21:10] clean started ... 
[10:21:10] clean finished in 4 ms 
[10:21:10] copy started ... 
[10:21:10] ngc started ... 
[10:21:10] copy finished in 32 ms 
[10:21:10] lint started ... 
[10:21:11] /Users/name/Documents/workspace/ionic/blabla/node_modules/@angular/compiler-cli/src/private_import_compiler.js:10 

[10:21:11] exports.AssetUrl = compiler_1. __compiler_private__.AssetUrl; 

[10:21:11] TypeError: Cannot read property 'AssetUrl' of undefined 

[10:21:11] ngc failed 

[10:21:11] ionic-app-script task: "build" 

[10:21:11] Error: Error 

npm
 ERR! Darwin 14.5.0
npm ERR!
 argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build"
npm ERR!
 node v6.9.1
npm ERR! npm 
 v3.10.8
npm ERR! code ELIFECYCLE

npm ERR! blabla@ build: `ionic-app-scripts build`
npm ERR!
 Exit status 1
npm ERR! 

npm ERR! Failed at the blabla@ build script 'ionic-app-scripts build'.
npm ERR!
 Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the blabla package,
npm ERR!
 not with npm itself.
npm ERR! Tell the author that this fails on your system:

npm ERR! ionic-app-scripts build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs blabla
npm ERR! Or if that is not available, you can get their info via:
npm ERR! npm owner ls blabla
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /Users/name/Documents/workspace/ionic/blabla/npm-debug.log

Caught exception:
 undefined 

Mind letting us know? https://github.com/driftyco/ionic-cli/issues

[10:21:12] lint finished in 1.26 s 
(node:833) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: channel closed

```
