Ionic framework command line error undefined:1 SyntaxError: Unexpected token


#1

I am running windows 8.1 64 bit with node version 0.12.7 . I have installed both cordova and ionic globally all was working fine. But now every ionic command returns error .

example iconic --version 

undefined:1

SyntaxError: Unexpected token

i have reinstalled node and ionic but problem still persists.

but following npm command returns

>npm ls -g --depth=0

├── bower@1.3.12
├── cordova@5.1.1
├── electron-prebuilt@0.29.2
├── forever@0.14.1
├── ionic@1.6.1
├── nodemon@1.3.7
├── pm2@0.12.4
├── stylus@0.50.0
├── vs-mda@0.1.19
└── vs-mda-targets@0.1.12

#2

-> example iconic --version ?

Try: $ionic info


#3
> ionic info

undefined:1

^
SyntaxError: Unexpected token

#4

I’m also experiencing this issue, did you ever find a solution?


#5

i have the same problem


Ionic Unexpected token 1
#6

I figured out the issue on another thread

My C:\Users\USER\ .ionic\ionic.config had been corrupted and deleting it solved the issue

if that’s not the issue then navigate to where you have ionic installed, for me it’s
C:\Users\USER\AppData\Roaming\npm\node_modules\ionic\lib\ionic

then open a command prompt and run "npm install -g node-debug
after installing run “node-debug app.js” from that folder and step through the program to identify the error