Skip to content
This repository has been archived by the owner on Apr 2, 2018. It is now read-only.

Plugin installation failed due to SyntaxError: Unexpected token } #83

Open
mrameezraja opened this issue Apr 23, 2015 · 10 comments
Open

Comments

@mrameezraja
Copy link

I am getting below error on running

cordova plugin add com.ionic.keyboard

and unable to install plugin.

SyntaxError: Unexpected token }
at Object.parse (native)
at getJson (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/metadata.js:29:31)
at Object.exports.save_fetch_metadata (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/metadata.js:56:24)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/fetch.js:148:18
at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)
at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:557:44
at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17)
at process._tickCallback (node.js:419:13)

@tlancina
Copy link
Contributor

What version of Cordova are you using?

@mrameezraja
Copy link
Author

Well i have solved the issue. There is a file 'fetch.json' in plugins folder. There was an extra '}' in it. I just removed it and all went well.

This was not a issue with ionic keyboard plugin. It doesn't allow me add any plugin.

Thanks

@nguyenphong1301
Copy link

i have the same issue
Failed to install 'com.jcjee.plugins.emailcomposer':SyntaxError: Unexpected token <
at Object.parse (native)
at Function.PlatformJson.load (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/cordova-common/src/PlatformJson.js:35:21)
at new PlatformApiPoly (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/platforms/PlatformApiPoly.js:66:39)
at Object.getPlatformApi (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/platforms/platforms.js:59:23)
at handleInstall (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:602:29)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:382:28
at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)
at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:509:49
Error: Unexpected token <

and i have tried to install the last version of cordova but not work

@caomus-tp
Copy link

Yes, I have the same.
i try install plugin other.
SyntaxError: Unexpected token }
at Object.parse (native)
at getJson (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/metadata.js:29:31)
at Object.exports.save_fetch_metadata (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/metadata.js:56:24)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/fetch.js:165:18
at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)
at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:557:44
at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17)
at doNTCallback0 (node.js:417:9)

@vishal41190
Copy link

+1

cordova plugin add com.ionic.keyboard

/usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/lib/state.js:543
throw 'Error executing "' + pluginCommand + '":\n' + output;
^
Error executing "cordova plugin add com.ionic.keyboard":
Fetching plugin "com.ionic.keyboard" via npm
Error: Failed to fetch plugin com.ionic.keyboard via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: Registry returned 404 for GET on https://registry.npmjs.org/com.ionic.keyboard

@mrameezraja
Copy link
Author

try using "cordova plugin add ionic-plugin-keyboard"

plugin id has been changed to "ionic-plugin-keyboard" from "com.ionic.keyboard".

@kumaro
Copy link

kumaro commented Feb 3, 2016

I experienced this issue today. "cordova plugin add ionic-plugin-keyboard" worked for me

@caomus-tp
Copy link

I use it ^^
Pulgin because some applications do not have to enter data or packget.json go wrong.
Note that you see ",".

thx.

@sameerrswt
Copy link

i am getting this error please help.

@mrameezraja
Copy link
Author

@sameerrswt use cordova plugin add ionic-plugin-keyboard

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants