• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

如何在生产模式下创建应用程序Ionic3?

angular 来源:Вова Журавлёв 3次浏览

我想让我的应用程序在离子3上生成模式。我尝试如何在生产模式下创建应用程序Ionic3?

ionic cordova run android --prod --release 

但我一直错误:

Error: Encountered undefined provider! Usually this means you have a circular dependencies (might be caused by using ‘barrel’ index.ts files.

我的package.json模样为:

{ 
    "name": "ionic-wordpress", 
    "version": "0.0.1", 
    "author": "IonicThemes", 
    "homepage": "https://ionicthemes.com/", 
    "private": true, 
    "scripts": { 
    "clean": "ionic-app-scripts clean", 
    "build": "ionic-app-scripts build", 
    "lint": "ionic-app-scripts lint", 
    "ionic:build": "ionic-app-scripts build", 
    "ionic:serve": "ionic-app-scripts serve" 
    }, 
    "dependencies": { 
    "@angular/common": "4.1.3", 
    "@angular/compiler": "4.1.3", 
    "@angular/compiler-cli": "4.1.3", 
    "@angular/core": "4.1.3", 
    "@angular/forms": "4.1.3", 
    "@angular/http": "4.1.3", 
    "@angular/platform-browser": "4.1.3", 
    "@angular/platform-browser-dynamic": "4.1.3", 
    "@ionic-native/core": "3.12.1", 
    "@ionic-native/native-storage": "^4.2.1", 
    "@ionic-native/splash-screen": "3.12.1", 
    "@ionic-native/status-bar": "3.12.1", 
    "@ionic/storage": "^2.1.3", 
    "android-versions": "^1.2.1", 
    "cordova-android": "^6.3.0", 
    "cordova-browser": "^4.1.0", 
    "cordova-ios": "^4.4.0", 
    "cordova-plugin-console": "^1.1.0", 
    "cordova-plugin-device": "^1.1.7", 
    "cordova-plugin-nativestorage": "^2.2.2", 
    "cordova-plugin-splashscreen": "^4.1.0", 
    "cordova-plugin-statusbar": "^2.3.0", 
    "cordova-plugin-whitelist": "^1.3.3", 
    "ionic-angular": "3.6.0", 
    "ionic-plugin-keyboard": "^2.2.1", 
    "ionicons": "3.0.0", 
    "q": "^1.5.1", 
    "rxjs": "5.4.0", 
    "sw-toolbox": "3.6.0", 
    "zone.js": "0.8.12" 
    }, 
    "devDependencies": { 
    "@ionic/app-scripts": "2.1.3", 
    "ionic": "3.12.0", 
    "typescript": "2.3.4" 
    }, 
    "description": "An Ionic project", 
    "cordova": { 
    "plugins": { 
     "cordova-plugin-nativestorage": {}, 
     "cordova-plugin-console": {}, 
     "cordova-plugin-device": {}, 
     "cordova-plugin-splashscreen": {}, 
     "cordova-plugin-statusbar": {}, 
     "cordova-plugin-whitelist": {}, 
     "ionic-plugin-keyboard": {} 
    }, 
    "platforms": [ 
     "browser", 
     "ios", 
     "android" 
    ] 
    } 
} 

也是我的NPM-具有的debug.log下一错误

160758 error Linux 4.10.0-28-generic 
160759 error argv "/usr/bin/nodejs" "/usr/lib/node_modules/npm/bin/npm-cli.js" "install" "--scripts-prepend-node-path=auto" 
160760 error node v4.8.4 
160761 error npm v2.15.11 
160762 error code EPEERINVALID 
160763 error peerinvalid The package @ionic-native/[email protected] does not satisfy its siblings' peerDependencies requirements! 
160763 error peerinvalid Peer @ionic-native/[email protected] wants @ionic-native/[email protected]^4.2.0 
160763 error peerinvalid Peer @ionic-native/[email protected] wants @ionic-native/[email protected]^3.6.0 
160763 error peerinvalid Peer @ionic-native/[email protected] wants @ionic-native/[email protected]^3.6.0 
160764 verbose exit [ 1, true ] 

请帮我找个错误。如果在默认模式下运行的应用程序,它是工作正常

ionic cordova run android

我GOOGLE之前询问很多。谢谢。


===========解决方案如下:

我发现enter link description here解决了romeodenis5

@NgModule({ 
providers: [ storage, ... ] 
}) 
in app.module.ts 

NOTE since @ionic/storage 2.x.x 
we import 
IonicStorageModule instead of storage 

版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)