警告:
警告:无法解析存储的所有参数
/用户/zzm/desktop/minan/node_modules/@ionic/storage/es2015/storage.d.ts:
(?)。这将成为角度v5.x中的错误
我已经按照答案做了。但是,当我构建IOSAndroid时,我会显示这个警告。
包.json

{
    "name": "ionic-hello-world",
    "author": "He Yuyang",
    "homepage": "http://ionicframework.com/",
    "private": true,
    "scripts": {
        "clean": "ionic-app-scripts clean",
        "build": "ionic-app-scripts build",
        "ionic:build": "ionic-app-scripts build",
        "ionic:serve": "ionic-app-scripts serve"
    },
    "dependencies": {
        "@angular/common": "4.0.0",
        "@angular/compiler": "4.0.0",
        "@angular/compiler-cli": "4.0.0",
        "@angular/core": "4.0.0",
        "@angular/forms": "4.0.0",
        "@angular/http": "4.0.0",
        "@angular/platform-browser": "4.0.0",
        "@angular/platform-browser-dynamic": "4.0.0",
        "@angular/platform-server": "4.0.0",
        "@ionic-native/core": "4.1.0",
        "@ionic-native/facebook": "^4.1.0",
        "@ionic-native/in-app-browser": "^4.3.0",
        "@ionic-native/onesignal": "^4.2.1",
        "@ionic-native/photo-viewer": "^4.1.0",
        "@ionic-native/qqsdk": "^4.1.0",
        "@ionic-native/social-sharing": "^4.1.0",
        "@ionic/storage": "2.0.0",
        "com-sarriaroman-photoviewer": "^1.1.10",
        "cordova-android": "^6.2.3",
        "cordova-ios": "^4.4.0",
        "cordova-plugin-console": "^1.0.5",
        "cordova-plugin-device": "^1.1.4",
        "cordova-plugin-facebook4": "^1.9.1",
        "cordova-plugin-inappbrowser": "^1.7.1",
        "cordova-plugin-qqsdk": "^0.9.6",
        "cordova-plugin-splashscreen": "^4.0.3",
        "cordova-plugin-statusbar": "^2.2.1",
        "cordova-plugin-wechat": "^2.0.0",
        "cordova-plugin-whitelist": "^1.3.2",
        "cordova-plugin-x-socialsharing": "^5.2.0",
        "es6-promise-plugin": "^4.1.0",
        "ionic-angular": "3.6.0",
        "ionic-img-viewer": "^2.6.1",
        "ionic-native": "2.4.1",
        "ionic-plugin-keyboard": "^2.2.1",
        "ionicons": "3.0.0",
        "onesignal-cordova-plugin": "^2.2.0",
        "rxjs": "5.0.0-beta.12",
        "sw-toolbox": "3.4.0",
        "zone.js": "0.6.26"
    },
    "devDependencies": {
        "@ionic/app-scripts": "^2.1.3",
        "typescript": "2.3.4"
    },
    "cordovaPlugins": [
        "cordova-plugin-whitelist",
        "cordova-plugin-console",
        "cordova-plugin-statusbar",
        "cordova-plugin-device",
        "ionic-plugin-keyboard",
        "cordova-plugin-splashscreen"
    ],
    "cordovaPlatforms": [],
    "description": "SidemenuTabs: An Ionic project",
    "cordova": {
        "plugins": {
            "cordova-plugin-console": {},
            "cordova-plugin-device": {},
            "cordova-plugin-splashscreen": {},
            "cordova-plugin-statusbar": {},
            "ionic-plugin-keyboard": {},
            "cordova-plugin-qqsdk": {
                "QQ_APP_ID": "1106340746"
            },
            "cordova-plugin-x-socialsharing": {},
            "com-sarriaroman-photoviewer": {},
            "cordova-plugin-facebook4": {
                "APP_ID": "2027324614162511",
                "APP_NAME": "民安-马来西亚"
            },
            "cordova-plugin-whitelist": {},
            "onesignal-cordova-plugin": {},
            "cordova-plugin-wechat": {
                "WECHATAPPID": "wxec56aa94e0b75717"
            },
            "cordova-plugin-inappbrowser": {}
        },
        "platforms": [
            "android",
            "ios"
        ]
    }
}

更新:
提供者用户数据
import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
import { Events } from 'ionic-angular';
import { Storage } from '@ionic/storage';

import 'rxjs/add/operator/map';

@Injectable()
export class UserDataProvider {
  HAS_LOGGED_IN = 'hasLoggedIn';

  constructor(public http: Http, public events: Events, public storage: Storage) {
    console.log('Hello UserDataProvider Provider');
  }

  login(user: any): void {
    this.storage.set(this.HAS_LOGGED_IN, true);
    this.setUser(user);
    this.events.publish('user:login');
  };

  signup(user: any): void {
    this.storage.set(this.HAS_LOGGED_IN, true);
    this.setUser(user);
    this.events.publish('user:signup');
  };

  logout(): void {
    this.storage.remove(this.HAS_LOGGED_IN);
    this.storage.remove('username');
    this.events.publish('user:logout');
  };

  setUser(user: any): void {
    this.storage.set('user', user);
  };

  getUser(): Promise<any> {
    return this.storage.get('user').then((value) => {
      return value;
    });
  };

  hasLoggedIn(): Promise<boolean> {
    return this.storage.get(this.HAS_LOGGED_IN).then((value) => {
      return value === true;
    });
  };
}

离子信息
cli包:(/usr/local/lib/node_模块)
@ionic/cli-utils  : 1.19.0
ionic (Ionic CLI) : 3.19.0

全球套餐:
cordova (Cordova CLI) : 7.0.1

本地包:
@ionic/app-scripts : 3.1.4
Cordova Platforms  : android 6.3.0 ios 4.4.0
Ionic Framework    : ionic-angular 3.9.2

系统:
ios-deploy : 1.9.2
Node       : v6.11.3
npm        : 3.10.10
OS         : macOS Sierra
Xcode      : Xcode 9.1 Build version 9B55

环境变量:
ANDROID_HOME : not set

其他:
backend : pro

最佳答案

我强烈建议将您的项目升级到latest Ionic和ionicapp-scripts
离子型3.9.2
请参阅此official package.json文件。
注意:删除node_modules文件夹并运行npm i

关于angular - 警告:无法解析PATH/node_modules/@ionic/storage/es2015/storage.d.ts中存储的所有参数:(?),我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/46703100/

10-13 06:32