【问题标题】:Error installing cordova plugin for SQLite为 SQLite 安装 cordova 插件时出错
【发布时间】:2018-07-27 02:13:22
【问题描述】:

我正在尝试使用以下命令为 SQLite 安装插件:

cordova plugin add https://github.com/litehelpers/Cordova-sqlite-storage.git

但我得到以下信息:

C:\Users\om\sunapp>cordova plugin add https://github.com/litehelpers/Cordova-sqlite-storage.git
(node:8180) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Failed
to fetch plugin https://github.com/litehelpers/Cordova-sqlite-storage.git via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: cmd: Command failed with exit code 1 Error output:
npm WARN addRemoteGit Error: not found: git
npm WARN addRemoteGit     at getNotFoundError (C:\Program Files\nodejs\node_modules\npm\node_modules
\which\which.js:14:12)
npm WARN addRemoteGit     at F (C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js
:69:19)
npm WARN addRemoteGit     at E (C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js
:81:29)
npm WARN addRemoteGit     at C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:90
:16
npm WARN addRemoteGit     at C:\Program Files\nodejs\node_modules\npm\node_modules\which\node_module
s\isexe\index.js:44:5
npm WARN addRemoteGit     at C:\Program Files\nodejs\node_modules\npm\node_modules\which\node_module
s\isexe\windows.js:29:5
npm WARN addRemoteGit     at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyf
ills.js:264:29
npm WARN addRemoteGit     at FSReqWrap.oncomplete (fs.js:123:15)
npm WARN addRemoteGit  git+https://github.com/litehelpers/Cordova-sqlite-storage.git resetting remot
e C:\Users\om\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-litehelpers-Cordova-sqlite
-storage-git-c710b464 because of error: { Error: not found: git
npm WARN addRemoteGit     at getNotFoundError (C:\Program Files\nodejs\node_modules\npm\node_modules
\which\which.js:14:12)
npm WARN addRemoteGit     at F (C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js
:69:19)
npm WARN addRemoteGit     at E (C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js
:81:29)
npm WARN addRemoteGit     at C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:90
:16
npm WARN addRemoteGit     at C:\Program Files\nodejs\node_modules\npm\node_modules\which\node_module
s\isexe\index.js:44:5
npm WARN addRemoteGit     at C:\Program Files\nodejs\node_modules\npm\node_modules\which\node_module
s\isexe\windows.js:29:5
npm WARN addRemoteGit     at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyf
ills.js:264:29
npm WARN addRemoteGit     at FSReqWrap.oncomplete (fs.js:123:15) code: 'ENOGIT' }
npm ERR! git clone --template=C:\Users\om\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror
 https://github.com/litehelpers/Cordova-sqlite-storage.git C:\Users\om\AppData\Roaming\npm-cache\_gi
t-remotes\git-https-github-com-litehelpers-Cordova-sqlite-storage-git-c710b464: undefined
npm ERR! git clone --template=C:\Users\om\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror
 https://github.com/litehelpers/Cordova-sqlite-storage.git C:\Users\om\AppData\Roaming\npm-cache\_gi
t-remotes\git-https-github-com-litehelpers-Cordova-sqlite-storage-git-c710b464: undefined
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\b
in\\npm-cli.js" "install" "https://github.com/litehelpers/Cordova-sqlite-storage.git" "--production"
 "--save"
npm ERR! node v6.10.3
npm ERR! npm  v3.10.10
npm ERR! code ENOGIT

npm ERR! not found: git
npm ERR!
npm ERR! Failed using git.
npm ERR! This is most likely not a problem with npm itself.
npm ERR! Please check if you have git installed and in your PATH.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\om\sunapp\npm-debug.log

我是第一次这样做,不明白问题是什么。我该如何解决这个问题?

【问题讨论】:

    标签: git sqlite cordova npm


    【解决方案1】:

    您的系统上没有安装 git。

    试试

     git --version
    

    检查git是否安装。

    如果它不打印版本,那么你必须通过以下命令安装 git:

    sudo apt-get install git-all
    

    安装 git 后,您可以尝试添加插件。

    cordova plugin add https://github.com/litehelpers/Cordova-sqlite-storage.git
    

    希望这会有所帮助。 干杯:)

    【讨论】:

    • 乐于助人:)
    猜你喜欢
    • 1970-01-01
    • 2023-03-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多