2015-05-22 164 views
1

我想添加這個插件https://github.com/MobileAppTracking/phonegap-plugin但是當我運行命令我看到這個錯誤:我無法安裝插件科爾多瓦

Error during processing of action! Attempting to revert... 
Failed to install 'com.mobileapptracking.matplugin':TypeError: Uh oh! 
Arguments to path.resolve must be strings 
    at Object.exports.resolve (path.js:313:15) 
    at module.exports.framework.install (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/android.js:106:31) 
    at Object.ActionStack.process (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/action-stack.js:70:25) 
    at handleInstall (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:567:20) 
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:322:20 
    at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:798:54) 
    at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:827:30) 
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:760:13) 
    at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:574:44 
    at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17) 
TypeError: Uh oh! 
Arguments to path.resolve must be strings 
    at Object.exports.resolve (path.js:313:15) 
    at module.exports.framework.install (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/android.js:106:31) 
    at Object.ActionStack.process (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/action-stack.js:70:25) 
    at handleInstall (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:567:20) 
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:322:20 
    at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:798:54) 
    at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:827:30) 
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:760:13) 
    at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:574:44 
    at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17) 

我的節點版本是v0.10.25
我NPM版本1.3.10
我科爾多瓦版本3.6.3-0.2.13

回答

9

應當更新科爾多瓦版本和科爾多瓦,機器人,刪除插件,清理其安裝的依賴,能有那麼一個新的乾淨的安裝插件的

  1. 更新科爾多瓦:

    sudo npm update -g cordova 
    
  2. 更新Android平臺

    cordova platform update android 
    
  3. 根據你的情況,看來你應該刪除插件

    cordova plugin remove com.mobileapptracking.matplugin 
    
  4. 手動刪除發揮您的目錄服務的依賴和 在android.json文件

  5. 然後重新安裝插件

    cordova plugin add https://github.com/MobileAppTracking/phonegap-plugin 
    
0

應當更新科爾多瓦版本和更新Android平臺或完全刪除它,然後再次添加它。

請更新科爾多瓦:

sudo npm update -g cordova 

,請使用以下命令

cordova platform rm android 

刪除你的android平臺,然後用下面的命令

cordova platform add android 

的希望加入平臺,這將幫助你!