无法解析离子配置文件.请确保它是有效的 JSON [英] Unable to parse Ionic Config file. Please make sure it is valid JSON

查看:32
本文介绍了无法解析离子配置文件.请确保它是有效的 JSON的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

突然间,我在尝试运行 ionic 时遇到了这个问题.怎么了?

All of a sudden, I'm getting this while trying to run ionic. What's wrong?

C:Users>ionic
Unable to parse Ionic Config file. Please make sure it is valid JSON (.ionic/ionic.config)

Caught exception:
 SyntaxError: Unexpected token
    at Object.parse (native)
    at Object.module.exports.load (C:UsersBBytesAppDataRoaming
pm
ode_modulesionic
ode_modulesionic-app-liblibconfig.js:14:26)
    at Object.<anonymous> (C:UsersBBytesAppDataRoaming
pm
ode_modulesioniclibutilsstats.js:31:31)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (C:UsersBBytesAppDataRoaming
pm
ode_modulesioniclibcli.js:3:18)

Mind letting us know? https://github.com/driftyco/ionic-cli/issues

推荐答案

我已经找到问题的根源了!我的 C:/Users/{username}/.ionic/ionic.config 文件在我的电脑崩溃时/或由于其他一些错误而损坏.

I've found the source of the problem! My C:/Users/{username}/.ionic/ionic.config file was corrupted when my pc crashed /or due to some other error.

奇怪的是,卸载 ionic 时该文件永远不会被清除.

Weird that that file NEVER gets cleared when uninstalling ionic.

只需删除文件,当您运行ionic serve 时,它会默认在文件夹中创建文件.

Just Delete the file and when you run ionic serve it will create the file by default in the folder.

这篇关于无法解析离子配置文件.请确保它是有效的 JSON的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆