Ionic framework 找不到模块';未满足/package.json';
我正在尝试在我的ionic应用程序中安装cordova插件。但每次我尝试安装的插件都会抛出一个错误: 找不到模块“未满足/package.json” 我已经多次删除路径:节点模块、插件、平台、www 我运行: npm安装 爱奥尼亚cordova插件添加cordova插件本地通知 爱奥尼亚cordova平台添加android 我试图改变这个顺序,但问题没有解决 我运行的是Ubuntu18,ionic版本是4.8.0,cordova版本是9.0.0,cordova lib 9.0.1,node版本是8.10.0,npm 3.5.2 我只是在终端运行这条线路:Ionic framework 找不到模块';未满足/package.json';,ionic-framework,ionic3,cordova-plugins,Ionic Framework,Ionic3,Cordova Plugins,我正在尝试在我的ionic应用程序中安装cordova插件。但每次我尝试安装的插件都会抛出一个错误: 找不到模块“未满足/package.json” 我已经多次删除路径:节点模块、插件、平台、www 我运行: npm安装 爱奥尼亚cordova插件添加cordova插件本地通知 爱奥尼亚cordova平台添加android 我试图改变这个顺序,但问题没有解决 我运行的是Ubuntu18,ionic版本是4.8.0,cordova版本是9.0.0,cordova lib 9.0.1,node版本是
ionic cordova plugin add cordova-plugin-local-notification
我的包json:
{
"name": "project-name",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"android": "ionic cordova run android",
"start": "ionic-app-scripts serve",
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
"buildAndroid": "ionic cordova build android --aot --minifyjs --minifycss"
},
"dependencies": {
"@angular/animations": "5.2.11",
"@angular/common": "5.2.11",
"@angular/compiler": "5.2.11",
"@angular/compiler-cli": "5.2.11",
"@angular/core": "5.2.11",
"@angular/fire": "^5.1.1",
"@angular/forms": "5.2.11",
"@angular/http": "5.2.11",
"@angular/platform-browser": "5.2.11",
"@angular/platform-browser-dynamic": "5.2.11",
"@ionic-native/background-geolocation": "^4.20.0",
"@ionic-native/base64": "^4.20.0",
"@ionic-native/camera": "^4.20.0",
"@ionic-native/core": "~4.18.0",
"@ionic-native/crop": "^4.20.0",
"@ionic-native/facebook": "^4.20.0",
"@ionic-native/geolocation": "^4.20.0",
"@ionic-native/google-plus": "^4.20.0",
"@ionic-native/local-notifications": "^4.20.0",
"@ionic-native/location-accuracy": "^4.20.0",
"@ionic-native/social-sharing": "^4.20.0",
"@ionic-native/splash-screen": "~4.18.0",
"@ionic-native/sqlite": "^4.20.0",
"@ionic-native/status-bar": "~4.18.0",
"@ionic/storage": "2.2.0",
"@mauron85/cordova-plugin-background-geolocation": "3.0.3",
"brmasker-ionic-3": "^1.6.3",
"com-badrit-base64": "^0.2.0",
"cordova-plugin-badge": "^0.8.8",
"cordova-plugin-camera": "^4.0.3",
"cordova-plugin-crop": "^0.4.0",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-geolocation": "4.0.2",
"cordova-plugin-googleplus": "7.0.2",
"cordova-plugin-ionic-keyboard": "^2.1.3",
"cordova-plugin-ionic-webview": "^3.1.2",
"cordova-plugin-local-notification": "0.9.0-beta.2",
"cordova-plugin-request-location-accuracy": "2.3.0",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-whitelist": "^1.3.3",
"cordova-plugin-x-socialsharing": "5.4.7",
"cordova-sqlite-storage": "^3.2.0",
"es6-promise-plugin": "4.2.2",
"firebase": "^5.8.4",
"ionic-angular": "3.9.3",
"ionicons": "3.0.0",
"ngx-multilingual": "0.0.3",
"rxjs": "5.5.11",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.29"
},
"devDependencies": {
"@ionic/app-scripts": "3.2.1",
"@ionic/lab": "1.0.20",
"typescript": "~2.6.2"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"cordova-plugin-whitelist": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-ionic-webview": {
"ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
},
"cordova-plugin-ionic-keyboard": {},
"cordova-sqlite-storage": {},
"com-badrit-base64": {},
"cordova-plugin-camera": {
"ANDROID_SUPPORT_V4_VERSION": "27.+"
},
"cordova-plugin-crop": {},
"cordova-plugin-mauron85-background-geolocation": {
"GOOGLE_PLAY_SERVICES_VERSION": "11+",
"ANDROID_SUPPORT_LIBRARY_VERSION": "26+",
"ICON": "@mipmap/icon",
"SMALL_ICON": "@mipmap/icon",
"ACCOUNT_NAME": "@string/app_name",
"ACCOUNT_LABEL": "@string/app_name",
"ACCOUNT_TYPE": "$PACKAGE_NAME.account",
"CONTENT_AUTHORITY": "$PACKAGE_NAME"
},
"cordova-plugin-googleplus": {
"PLAY_SERVICES_VERSION": "11.8.0"
},
"cordova-plugin-geolocation": {
"GEOLOCATION_USAGE_DESCRIPTION": "Para pegar as melhores promoções"
},
"cordova-plugin-request-location-accuracy": {
"PLAY_SERVICES_LOCATION_VERSION": "16.+"
},
"cordova-plugin-x-socialsharing": {
"ANDROID_SUPPORT_V4_VERSION": "24.1.1+"
},
"cordova-plugin-local-notification": {}
},
"platforms": [
"android"
]
}
}
但是每个插件都会抛出这个错误
我只需要在我的应用程序中再次安装插件。只需更新npm,你就可以再次构建:)你可以发布包json吗确保你在项目根目录中我编辑了这个问题,添加了包。json@orbit欢迎加入社区,谢谢你留下答案。如果OP不熟悉套餐管理和套餐回购,您能否提供更多细节?用一个包管理器说两句关于工作流程的话会很好。也许还有一份关于从哪里获得更多信息的声明。我会的,但npm不是我的专长。无论如何,这是你的答案,你应该得到所有的荣誉!谢谢