ionic framework command line error undefined:1 Syn

2019-09-14 16:58发布

I am running windows 8.1 64 bit with node version 0.12.7 .

I have install both cordova and ionic globally all was working fine. But now every ionic command returns error .

example ionic --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条回答
成全新的幸福
2楼-- · 2019-09-14 17:35

I have solved the issues in windows 7.

I just go to the below path

C:\Users.ionic\ionic.config

Delete the ionic.config file and go to the cmd prompt. Run the Below CLI.

ionic serve

Issue is solved. If you go to see the path again C:\Users.ionic

ionic.config file is regenerated. The Reason is ionic.config got corrupted.

查看更多
▲ chillily
3楼-- · 2019-09-14 17:59

I had same problem due to accidental power cut while working with Ionic. Tried to install Node, Cordova, and Ionic again and again but nothing helped me.

Found this solution in ionic framework thread:

  1. Navigate to C:\Users\USER\.ionic\ionic.config (Replace USER with your Username )
  2. Delete ionic.config file

Done!

查看更多
登录 后发表回答