gpt4 book ai didi

angular - 警告 : Can't resolve all parameters for Storage in PATH/node_modules/@ionic/storage/es2015/storage. d.ts : (? )

转载 作者:搜寻专家 更新时间:2023-10-30 21:49:57 26 4
gpt4 key购买 nike

警告:

Warning: Can't resolve all parameters for Storage in /Users/zzm/Desktop/minan/node_modules/@ionic/storage/es2015/storage.d.ts: (?). This will become an error in Angular v5.x

我关注了this回答并且已经做了。但是,当我构建 IOSAndroid 时,仍然会向我显示此警告。

Package.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"
]
}
}

更新:提供商 user-data.ts

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;
});
};
}

ionic 信息

cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils  : 1.19.0
ionic (Ionic CLI) : 3.19.0

global packages:

cordova (Cordova CLI) : 7.0.1

local packages:

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

System:

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

Environment Variables:

ANDROID_HOME : not set

Misc:

backend : pro

最佳答案

我强烈建议将您的项目升级到最新的 Ionic 和 Ionic app-scripts

ionic 3.9.2

查看此 official package.json文件。

注意:之后删除node_modules文件夹并运行npm i

关于angular - 警告 : Can't resolve all parameters for Storage in PATH/node_modules/@ionic/storage/es2015/storage. d.ts : (? ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46703100/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com