# I get syntaxError when ionic upload

**URL:** <https://forum.ionicframework.com/t/i-get-syntaxerror-when-ionic-upload/29967>\
**Category:** uncategorized\
**Created:** [August 6, 2015, 1:24am UTC](https://forum.ionicframework.com/t/i-get-syntaxerror-when-ionic-upload/29967 "2015-08-06T01:24:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dpark1985](https://avatars.discourse-cdn.com/v4/letter/d/f08c70/32.png) [@dpark1985](https://forum.ionicframework.com/u/dpark1985)\
**Post date:** [August 6, 2015, 1:24am UTC](https://forum.ionicframework.com/t/i-get-syntaxerror-when-ionic-upload/29967/1 "2015-08-06T01:24:45Z")

</div>

I need a help .

I get this error message when trying to upload the app to Ionic View

```
SyntaxError: Unexpected token <
    at Object.parse (native)
    at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/lib/upload.js:292:25)
    at IncomingMessage.emit (events.js:129:20)
    at _stream_readable.js:908:16
    at process._tickCallback (node.js:355:11)

Unexpected token < (CLI v1.6.4)

Your system information:

Cordova CLI: 5.1.1
Ionic Version: 1.0.1
Ionic CLI Version: 1.6.4
Ionic App Lib Version: 0.3.8
ios-deploy version: Not installed
ios-sim version: 3.1.1 
OS: Mac OS X Yosemite
Node Version: v0.12.7
Xcode version: Xcode 6.3.1 Build version 6D1002 

```

This started to happen when I added $cordovaImagePicker

```
var options = {
    maximumImagesCount: 1
};
$ionicPlatform.ready(function() {
    $cordovaImagePicker.getPictures(options)
    .then(function (results) {
        for (var i = 0; i < results.length; i++) {
            console.log('Image URI: ' + results[i]);
        }
    }, function(error) {
      // error getting photos
    });
});

```

Please help me.

Thank you

---

<div class="post-metadata">

**Author:** ![gmarziou](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/gmarziou/32/13327_2.png) [@gmarziou](https://forum.ionicframework.com/u/gmarziou)\
**Post date:** [August 6, 2015, 11:04pm UTC](https://forum.ionicframework.com/t/i-get-syntaxerror-when-ionic-upload/29967/2 "2015-08-06T23:04:28Z")

</div>

> [@dpark1985](#):
>
> at IncomingMessage.\<anonymous\> (/usr/local/lib/node\_modules/ionic/node\_modules/ionic-app-lib/lib/upload.js:292:25)

Look at this file at line 292 as indicated, you’ll see that it failed to parse the JSON data in response sent by server.

```
    jsonData = JSON.parse(data);

```

So it has nothing to do with your app code.

If you can reproduce it easily, modify this file and log the data received and report it to Ionic support.

---

<div class="post-metadata">

**Author:** ![Hughred22](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/hughred22/32/74088_2.png) [@Hughred22](https://forum.ionicframework.com/u/Hughred22)\
**Post date:** [October 8, 2015, 1:30am UTC](https://forum.ionicframework.com/t/i-get-syntaxerror-when-ionic-upload/29967/3 "2015-10-08T01:30:36Z")

</div>

Same issue here… I can not upload to [ionic.io](http://ionic.io) or set push environment… It happens today.

---

<div class="post-metadata">

**Author:** ![cemart](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/cemart/32/79672_2.png) [@cemart](https://forum.ionicframework.com/u/cemart)\
**Post date:** [October 9, 2015, 4:18am UTC](https://forum.ionicframework.com/t/i-get-syntaxerror-when-ionic-upload/29967/4 "2015-10-09T04:18:18Z")

</div>

My solution was to delete the app\_id on app\_id

---

<div class="post-metadata">

**Author:** ![gentlemanjohn](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/gentlemanjohn/32/85288_2.png) [@gentlemanjohn](https://forum.ionicframework.com/u/gentlemanjohn)\
**Post date:** [October 12, 2015, 9:39pm UTC](https://forum.ionicframework.com/t/i-get-syntaxerror-when-ionic-upload/29967/5 "2015-10-12T21:39:18Z")

</div>

Did you upgrade npm recently? I ran into this issue when I upgraded npm to v\_2.14.7 (as part of an upgrade to node.js v4.2.0). I downgraded npm to the version that last worked for me: v\_2.14.2

```
npm install -g npm@2.14.2

```

Everything back to normal when I `ionic upload` now.
