faild安装cordova插件谷歌地图

时间:2017-10-31 07:00:40

标签: android ionic-framework ionic2 cordova-plugins ionic-native

我使用 ionic2 开发混合应用,并希望在我的应用中使用离线原生的 googleAPI ...现在我的PC操作系统是Windows10!我可以使用适用于ios ???的原生离子API吗?

当我运行这个命令时,这个问题就出现了:

     ionic cordova plugin add cordova-plugin-googlemaps --variable API_KEY_FOR_ANDROID="API-Key" --variable API_KEY_FOR_IOS="API-Key"

似乎ios的谷歌地图是安装的,但是当我为ios安装googlem地图时出现错误!

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   'https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk',
1 verbose cli   '--production',
1 verbose cli   '--save' ]
2 info using npm@3.10.10
3 info using node@v6.10.3
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly fetchPackageMetaData https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk
8 silly fetchOtherPackageData https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk
9 silly cache add args [ 'https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk',
9 silly cache add   null ]
10 verbose cache add spec https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk
11 silly cache add parsed spec Result {
11 silly cache add   raw: 'https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk',
11 silly cache add   scope: null,
11 silly cache add   escapedName: null,
11 silly cache add   name: null,
11 silly cache add   rawSpec: 'https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk',
11 silly cache add   spec: 'git+https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git',
11 silly cache add   type: 'hosted',
11 silly cache add   hosted:
11 silly cache add    { type: 'github',
11 silly cache add      ssh: 'git@github.com:mapsplugin/cordova-plugin-googlemaps-sdk.git',
11 silly cache add      sshUrl: 'git+ssh://git@github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git',
11 silly cache add      httpsUrl: 'git+https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git',
11 silly cache add      gitUrl: 'git://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git',
11 silly cache add      shortcut: 'github:mapsplugin/cordova-plugin-googlemaps-sdk',
11 silly cache add      directUrl: 'https://raw.githubusercontent.com/mapsplugin/cordova-plugin-googlemaps-sdk/master/package.json' } }
12 verbose addRemoteGit caching https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk
13 verbose addRemoteGit git+https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git is a repository hosted by github
14 silly tryClone cloning git+https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git via git+https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git
15 verbose tryClone git-https-github-com-mapsplugin-cordova-plugin-googlemaps-sdk-git-324aac43 not in flight; caching
16 verbose correctMkdir C:\Users\asus\AppData\Roaming\npm-cache\_git-remotes correctMkdir not in flight; initializing
17 info git [ 'config', '--get', 'remote.origin.url' ]
18 silly validateExistingRemote git+https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git remote.origin.url: https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git
19 verbose validateExistingRemote git+https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git is updating existing cached remote C:\Users\asus\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-mapsplugin-cordova-plugin-googlemaps-sdk-git-324aac43
20 info git [ 'fetch', '-a', 'origin' ]
21 verbose updateRemote git fetch -a origin (https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git)
22 verbose setPermissions git+https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git skipping chownr on Windows
23 verbose resolveHead git+https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git original treeish: master
24 info git [ 'rev-list', '-n1', 'master' ]
25 silly resolveHead git+https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git resolved treeish: 0addb071b77be74cc1813cedea0797a207522628
26 verbose resolveHead git+https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git resolved Git URL: git+https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git#0addb071b77be74cc1813cedea0797a207522628
27 silly resolveHead Git working directory: C:\Users\asus\AppData\Local\Temp\npm-7544-cbb63627\git-cache-2b5ce209\0addb071b77be74cc1813cedea0797a207522628
28 info git [ 'clone',
28 info git   'C:\\Users\\asus\\AppData\\Roaming\\npm-cache\\_git-remotes\\git-https-github-com-mapsplugin-cordova-plugin-googlemaps-sdk-git-324aac43',
28 info git   'C:\\Users\\asus\\AppData\\Local\\Temp\\npm-7544-cbb63627\\git-cache-2b5ce209\\0addb071b77be74cc1813cedea0797a207522628' ]
29 error git clone C:\Users\asus\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-mapsplugin-cordova-plugin-googlemaps-sdk-git-324aac43 C:\Users\asus\AppData\Local\Temp\npm-7544-cbb63627\git-cache-2b5ce209\0addb071b77be74cc1813cedea0797a207522628: Cloning into 'C:\Users\asus\AppData\Local\Temp\npm-7544-cbb63627\git-cache-2b5ce209\0addb071b77be74cc1813cedea0797a207522628'...
29 error git clone C:\Users\asus\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-mapsplugin-cordova-plugin-googlemaps-sdk-git-324aac43 C:\Users\asus\AppData\Local\Temp\npm-7544-cbb63627\git-cache-2b5ce209\0addb071b77be74cc1813cedea0797a207522628: error: cannot spawn sh: No such file or directory
29 error git clone C:\Users\asus\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-mapsplugin-cordova-plugin-googlemaps-sdk-git-324aac43 C:\Users\asus\AppData\Local\Temp\npm-7544-cbb63627\git-cache-2b5ce209\0addb071b77be74cc1813cedea0797a207522628: fatal: unable to fork
30 silly fetchPackageMetaData Error: Command failed: git -c core.longpaths=true clone C:\Users\asus\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-mapsplugin-cordova-plugin-googlemaps-sdk-git-324aac43 C:\Users\asus\AppData\Local\Temp\npm-7544-cbb63627\git-cache-2b5ce209\0addb071b77be74cc1813cedea0797a207522628
30 silly fetchPackageMetaData Cloning into 'C:\Users\asus\AppData\Local\Temp\npm-7544-cbb63627\git-cache-2b5ce209\0addb071b77be74cc1813cedea0797a207522628'...
30 silly fetchPackageMetaData error: cannot spawn sh: No such file or directory
30 silly fetchPackageMetaData fatal: unable to fork
30 silly fetchPackageMetaData
30 silly fetchPackageMetaData     at ChildProcess.exithandler (child_process.js:204:12)
30 silly fetchPackageMetaData     at emitTwo (events.js:106:13)
30 silly fetchPackageMetaData     at ChildProcess.emit (events.js:191:7)
30 silly fetchPackageMetaData     at maybeClose (internal/child_process.js:886:16)
30 silly fetchPackageMetaData     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
30 silly fetchPackageMetaData  error for https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk { Error: Command failed: git -c core.longpaths=true clone C:\Users\asus\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-mapsplugin-cordova-plugin-googlemaps-sdk-git-324aac43 C:\Users\asus\AppData\Local\Temp\npm-7544-cbb63627\git-cache-2b5ce209\0addb071b77be74cc1813cedea0797a207522628
30 silly fetchPackageMetaData Cloning into 'C:\Users\asus\AppData\Local\Temp\npm-7544-cbb63627\git-cache-2b5ce209\0addb071b77be74cc1813cedea0797a207522628'...
30 silly fetchPackageMetaData error: cannot spawn sh: No such file or directory
30 silly fetchPackageMetaData fatal: unable to fork
30 silly fetchPackageMetaData
30 silly fetchPackageMetaData     at ChildProcess.exithandler (child_process.js:204:12)
30 silly fetchPackageMetaData     at emitTwo (events.js:106:13)
30 silly fetchPackageMetaData     at ChildProcess.emit (events.js:191:7)
30 silly fetchPackageMetaData     at maybeClose (internal/child_process.js:886:16)
30 silly fetchPackageMetaData     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
30 silly fetchPackageMetaData   killed: false,
30 silly fetchPackageMetaData   code: 128,
30 silly fetchPackageMetaData   signal: null,
30 silly fetchPackageMetaData   cmd: 'git -c core.longpaths=true clone C:\\Users\\asus\\AppData\\Roaming\\npm-cache\\_git-remotes\\git-https-github-com-mapsplugin-cordova-plugin-googlemaps-sdk-git-324aac43 C:\\Users\\asus\\AppData\\Local\\Temp\\npm-7544-cbb63627\\git-cache-2b5ce209\\0addb071b77be74cc1813cedea0797a207522628' }
31 silly rollbackFailedOptional Starting
32 silly rollbackFailedOptional Finishing
33 silly runTopLevelLifecycles Finishing
34 silly install printInstalled
35 verbose stack Error: Command failed: git -c core.longpaths=true clone C:\Users\asus\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-mapsplugin-cordova-plugin-googlemaps-sdk-git-324aac43 C:\Users\asus\AppData\Local\Temp\npm-7544-cbb63627\git-cache-2b5ce209\0addb071b77be74cc1813cedea0797a207522628
35 verbose stack Cloning into 'C:\Users\asus\AppData\Local\Temp\npm-7544-cbb63627\git-cache-2b5ce209\0addb071b77be74cc1813cedea0797a207522628'...
35 verbose stack error: cannot spawn sh: No such file or directory
35 verbose stack fatal: unable to fork
35 verbose stack
35 verbose stack     at ChildProcess.exithandler (child_process.js:204:12)
35 verbose stack     at emitTwo (events.js:106:13)
35 verbose stack     at ChildProcess.emit (events.js:191:7)
35 verbose stack     at maybeClose (internal/child_process.js:886:16)
35 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
36 verbose cwd D:\imanSal\apachemobile\Hellow\hell
37 error Windows_NT 10.0.10586
38 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk" "--production" "--save"
39 error node v6.10.3
40 error npm  v3.10.10
41 error code 128
42 error Command failed: git -c core.longpaths=true clone C:\Users\asus\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-mapsplugin-cordova-plugin-googlemaps-sdk-git-324aac43 C:\Users\asus\AppData\Local\Temp\npm-7544-cbb63627\git-cache-2b5ce209\0addb071b77be74cc1813cedea0797a207522628
42 error Cloning into 'C:\Users\asus\AppData\Local\Temp\npm-7544-cbb63627\git-cache-2b5ce209\0addb071b77be74cc1813cedea0797a207522628'...
42 error error: cannot spawn sh: No such file or directory
42 error fatal: unable to fork
43 error If you need help, you may report this error at:
43 error     <https://github.com/npm/npm/issues>
44 verbose exit [ 1, true ]

这是Error的日志。当我重复这个推荐时,我先得到这个:

plugin "cordova-plugin-googlemaps" already installed for android!!!

1 个答案:

答案 0 :(得分:1)

$> cordova platform rm android ios
$> cordova plugin rm cordova-plugin-googlemaps
$> cordova plugin add cordova-plugin-googlemaps --variable API_KEY_FOR_ANDROID="API-Key" --variable API_KEY_FOR_IOS="API-Key" --no-fetch
$> cordova platform add android ios
相关问题