尚未安装Cordova插件地理位置

时间:2019-09-10 08:44:30

标签: ionic-framework ionic4

我正在开发离子4应用程序。我想添加地理位置插件,并使用“离子Cordova插件添加cordova-plugin-geolocation”。执行命令时出现错误

cordova.cmd plugin add cordova-plugin-geolocation
npm: Command failed with exit code 1 Error output:
npm ERR! code E400
npm ERR! 400 Bad Request - GET https://registry.npmjs.org/cordova-plugin-geolocation

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\username\AppData\Roaming\npm-cache\_logs\2019-09-10T08_17_48_727Z-debug.log
[ERROR] An error occurred while running subprocess cordova.

    cordova.cmd plugin add cordova-plugin-geolocation exited with exit code 1.

    Re-running this command with the --verbose flag may provide more information.

1 个答案:

答案 0 :(得分:0)

您能否在离子项目目录中使用以下命令

ionic cordova plugin add cordova-plugin-geolocation
npm install @ionic-native/geolocation