2013-10-31 42 views
1

我爲我的最新項目使用Phonegap 3.0。我試圖添加本地sqlite數據庫插件來預先填充現有數據庫中的數據。問題是我可以通過命令行安裝插件。這表明以下錯誤:從命令行添加SQLite插件到Phonegap 3.0

#phonegap local plugin add https://github.com/jarlehansen/PhoneGap-SQLitePlugin-iOS.git 

adding the plugin: 
https://github.com/jarlehansen/PhoneGap-SQLitePlugin-iOS.git 

fs.js:427 return binding.open(pathModule._makeLong(path), 
stringToFlags(flags), mode); 
       ^Error: ENOENT, no such file or directory '/var/folders/7j/1qkbsztx3_bgtslq3pnnr9jc0000gn/T/plugman-tmp1383202788796/plugin.xml' 
    at Object.fs.openSync (fs.js:427:18) 
    at Object.fs.readFileSync (fs.js:284:15) 
    at Object.module.exports.parseElementtreeSync (/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/plugman/src/util/xml-helpers.js:119:27) 
    at /usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/plugman/src/util/plugins.js:67:39 
    at /usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/shelljs/shell.js:1707:7 
    at ChildProcess.exithandler (child_process.js:635:7) 
    at ChildProcess.EventEmitter.emit (events.js:98:17) 
    at maybeClose (child_process.js:735:16) 
    at Socket.<anonymous (child_process.js:948:11) 
    at Socket.EventEmitter.emit (events.js:95:17) 

我試圖通過導入頭文件和主文件和js文件,然後通過添加功能config.xml中手動安裝該插件。但那也是失敗的。

請幫我在PhoneGap的3.0安裝這個插件

回答

0

是在我腦海中時,有沒有這樣的文件或目錄的第一件事是,該目錄不存在,因爲無論嘗試創建它沒有有適當的權限。

嘗試檢查的權限(這可能只是與「須藤」運行它的問題)

+0

我用sudo但是結果相同 – ShafiVayyattukavil

0

這是一個遠射,但我發現有時當我用科爾多瓦命令行中只安裝工作。下載其bin和嘗試以下操作:

cordova install --platform <android/ios> --project <project dir> --plugin <plugin's git> 
+0

其實我通過使用不同的插件解決了這個問題 – ShafiVayyattukavil

1

在科爾多瓦,您可以安裝從遠程位置插件這樣的:

cordova plugin add https://github.com/brodysoft/Cordova-SQLitePlugin.git 

但我猜你需要爲前提的Git本地安裝。不確定PhoneGap命令的外觀如何。積分轉至here