ionic-team / ionic-plugin-keyboard

Ionic Keyboard Plugin for Cordova
Apache License 2.0
610 stars 275 forks source link

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

Open mrameezraja opened 9 years ago

mrameezraja commented 9 years ago

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 commented 9 years ago

What version of Cordova are you using?

mrameezraja commented 9 years ago

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 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

+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 commented 8 years ago

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

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

kumaro commented 8 years ago

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

caomus-tp commented 8 years ago

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

thx.

sameerrswt commented 8 years ago

i am getting this error please help.

mrameezraja commented 8 years ago

@sameerrswt use cordova plugin add ionic-plugin-keyboard