Monday, 23 May 2016

cordova setup , fail to run cordova plugin add org.apache.cordova.device

If you are using any tutorials like this to setup your project, then you will have below issues:

10:08:22-workshop>cordova plugin add org.apache.cordova.device
WARNING: org.apache.cordova.device has been renamed to cordova-plugin-device. You may not be getting the latest version! We suggest you `cordova plugin rm org.apache.cordova.device` and `cordova plugin add cordova-plugin-device`.
Fetching plugin "org.apache.cordova.device" via cordova plugins registry
npm http GET

npm http GET
npm http GET
Fetching from cordova plugins registry failed: connect ETIMEDOUT
Fetching plugin "org.apache.cordova.device" via npm
npm http GET
npm http 404
TypeError: Cannot read property 'latest' of undefined
    at next (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/lib/cache.js:687:35)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/lib/cache.js:675:5
    at saved (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/npm-registry-client/lib/get.js:142:7)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:133:7

    at Object.oncomplete (fs.js:108:15)


Cordova has move all plugins to npm, to avoid and stop old things, they have changed plugins'name.


change :

cordova plugin add org.apache.cordova.device

to :

cordova plugin add cordova-plugin-device

No comments:

Post a comment