简体   繁体   English

离子框架命令行错误未定义:1语法错误:意外的令牌

[英]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: 在离子框架线程中找到了此解决方案:

  1. Navigate to C:\\Users\\USER\\.ionic\\ionic.config (Replace USER with your Username ) 导航到C:\\Users\\USER\\.ionic\\ionic.config (将USER替换为您的Username)
  2. Delete ionic.config file 删除ionic.config文件

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.

相关问题 ionic cli:所有给出错误的命令undefined:1 SyntaxError:意外的令牌 - ionic cli: all commands giving error undefined:1 SyntaxError: Unexpected token nuxt.js安装:使用命令行工具SyntaxError创建项目时出错:Unexpected token) - nuxt.js installation: error while create project with command line tool SyntaxError: Unexpected token ) linux 环境中的 pm2 命令错误“SyntaxError: Unexpected token” - pm2 command error 'SyntaxError: Unexpected token' in linux environment 未知错误:SyntaxError:ng 命令上出现意外的令牌“导出” - Unknown error: SyntaxError: Unexpected token 'export' on ng command javascript 错误 - “SyntaxError: Unexpected token '&lt;' (anonymous function)”在第一行 - javascript error - “SyntaxError: Unexpected token '<' (anonymous function)” in the very first line 表达错误:SyntaxError: Unexpected token ':' - Express error: SyntaxError: Unexpected token ':' SyntaxError:nodejs中的意外令牌错误 - SyntaxError: Unexpected token error in nodejs Ionic2打字稿设备构建错误&#39;uglifyjs失败:语法错误:意外的令牌运算符«=»,预期的标点«,» - Ionic2 Typescript Device Build Error 'uglifyjs failed: SyntaxError: Unexpected token operator «=», expected punc «,»` 错误:(SystemJS) 意外标记 &lt; SyntaxError: Unexpected token &lt; at eval (<anonymous> ) 角 2 - Error: (SystemJS) Unexpected token < SyntaxError: Unexpected token < at eval (<anonymous>) Angular 2 undefined:1 undefined ^ SyntaxError: JSON 中的意外标记 u 在 position 0 - undefined:1 undefined ^ SyntaxError: Unexpected token u in JSON at position 0
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM