Closed dragonfly95 closed 6 years ago
I'm getting this same issue this very morning ;-(
cleaned cache uninstalled node re-installed node 6.9.1 LTS npm config get prefix and made sure /usr/local
chown'd permissions to make sure: sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share} sudo npm install -g ionic cordova
RUN & MESSAGE: $ npm install -g ionic cordova npm WARN deprecated node-uuid@1.4.7: use uuid module instead /usr/local/bin/cordova -> /usr/local/lib/node_modules/cordova/bin/cordova /usr/local/bin/ionic -> /usr/local/lib/node_modules/ionic/bin/ionic /usr/local/lib ├── cordova@6.4.0 └── ionic@2.1.12
STILL GET ERROR when: ionic info or try to build with ionic start...
MESSAGE: ionic info
Unable to parse Ionic Config file. Please make sure it is valid JSON (.ionic/ionic.config)
Caught exception:
SyntaxError: Unexpected end of JSON input
at Object.parse (native)
at Object.load (/usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/lib/config.js:14:26)
at Object.
Mind letting us know? https://github.com/driftyco/ionic-cli/issues
UPDATE: I even tried: brew uninstall node brew install node
UPDATE: I have also tried yarn CLI could not get it to work.
I have also tried to make sure all my permissions on npm on my dev is OK with new build and installs and re-installs and re-builds of my dev machine multiple times. Ref: https://docs.npmjs.com/getting-started/fixing-npm-permissions
then... npm install -g ionic cordova ...nope still not working. OK, I gotta just stop and drop out of Ionic 2 for a while.Too many changes to the framework and breaking my builds almost twice weekly. Killing me. Anyway, it's back to latest build of Android Studio for the next few days I guess until we get some solid resolutions to these build issues.
#UPDATE 11/21/2016: Houston, we have a go woohoo! Ughhhh....kool finally can go back to work with Ionic 2! OK: Found the fix here: https://forum.ionicframework.com/t/ionic-command-not-work/19452/5You'll want to edit the file, .eg: sudo nano /usr/local/lib/node_modules/ionic-app-lib/lib/config.js
or $ cd /usr/local/lib/node_modules/ionic-app-lib/lib/ $ atom . or $code . or whatever. Open the config.js file in the dir
then....change line 7 as it is if you install ionic@latest as of 11/21/2016: CONFIG_FILE: '.ionic/ionic.config', To have a slash after the dot:
CONFIG_FILE: './ionic/ionic.config',
Then save the file, and try running an ionic command: ionic info or whatever Ionic CLI command you need to run! Done.
CONFIG_FILE: '.ionic/ionic.config', To have a slash after the dot:
CONFIG_FILE: './ionic/ionic.config',
is the right answer thanks ;)
thanks
Just delete {user}/.ionic/ionic.config.json and run ionic serve It will be fixed. Delete this from terminal.
@seokochin solution worked like a charm!
I also did everything before...uninstalling node, and so. But just deleting ionic.config was the solution. Keep in mind that the file is in your home folder, not in the folder where you have your app.
As the problem appeared suddenly, I was not convinced by the config_file solution, as I didn't modified anything before the error. So I was thinking more in some corrupted file problem, and @seokochin solution was more logical in that case.
Thanks!
Thanks @seokochin This worked for me as well
Comments were causing problem for me. it needs to be pure simple json structure like following:
{
"name": "ionic3-sample",
"app_id": "",
"type": "ionic-angular",
"integrations": {
"cordova": {}
},
"proxies": [
{
"path": "/JSON",
"proxyUrl": "http://192.168.1.123/JSON"
}
]
}
thanks a lot @seokochin you save my time a lot..
the easy way just delete file config.json located in C:.ionic\config.json then ionic serve again and solved :dango:
Goto this path- C:/Users/{username}/.ionic find file (ionic.config) and delete that file.
@Vajidbaba thanks its working for me
Note: for support questions, please use one of these channels:
https://forum.ionicframework.com/ http://ionicworldwide.herokuapp.com/
Note: for build related issues you can open up an issue on the ionic-app-scripts repo
https://github.com/driftyco/ionic-app-scripts
Short description of the problem:
Unable to parse Ionic Config file. Please make sure it is valid JSON (.ionic/ionic.config) Caught exception: SyntaxError: Unexpected end of input at Object.parse (native) at Object.module.exports.load (/usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/lib/config.js:14:26) at Object. (/usr/local/lib/node_modules/ionic/lib/utils/stats.js:31:31)
at Module._compile (module.js:434:26)
at Object.Module._extensions..js (module.js:452:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object. (/usr/local/lib/node_modules/ionic/lib/cli.js:3:18)
What behavior are you expecting?
Steps to reproduce: 1. 2. 3.
Post the output of
ionic info
below pleaseOther information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)