[英]ionic framework command line error undefined:1 SyntaxError: Unexpected token
I am running windows 8.1 64 bit with node version 0.12.7 . 我正在使用节点版本0.12.7运行Windows 8.1 64位。
I have install both cordova and ionic globally all was working fine. 我已经在全球范围内同时安装了cordova和ionic,但一切正常。 But now every ionic command returns error . 但是现在每个离子命令都会返回错误 。
example ionic --version
undefined:1 未定义:1
SyntaxError: Unexpected token 语法错误:意外的令牌
i have reinstalled node and ionic but problem still persists. 我已经重新安装了node和ionic,但问题仍然存在。
but following npm command returns 但是以下npm命令返回
>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
I had same problem due to accidental power cut while working with Ionic. 由于与Ionic一起工作时意外断电,我遇到了同样的问题。 Tried to install Node, Cordova, and Ionic again and again but nothing helped me. 试图一次又一次安装Node,Cordova和Ionic,但没有任何帮助。
Found this solution in ionic framework thread: 在离子框架线程中找到了此解决方案:
C:\\Users\\USER\\.ionic\\ionic.config
(Replace USER with your Username ) 导航到C:\\Users\\USER\\.ionic\\ionic.config
(将USER替换为您的Username) Done! 做完了!
I have solved the issues in windows 7. 我已经解决了Windows 7中的问题。
I just go to the below path 我只是去下面的道路
C:\\Users.ionic\\ionic.config C:\\ Users.ionic \\ ionic.config
Delete the ionic.config file and go to the cmd prompt. 删除ionic.config文件,然后转到cmd提示符。 Run the Below CLI. 运行以下CLI。
ionic serve 离子发球
Issue is solved. 问题已解决。 If you go to see the path again C:\\Users.ionic 如果您再次查看路径C:\\ Users.ionic
ionic.config file is regenerated. ionic.config文件已重新生成。 The Reason is ionic.config got corrupted. 原因是ionic.config被损坏。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.