更新为离子3,但可能没有正确完成。运行时:
.sql
我收到以下错误,我似乎无法解决:
$ ionic g page AssetOneTimeList --verbose
这是在删除node_modules /之后,执行npm安装,完全重新安装node和ionic。
[DEBUG] Loading global plugin @ionic/cli-plugin-proxy
[DEBUG] Loading local plugin @ionic/cli-plugin-cordova
[DEBUG] Loading local plugin @ionic/cli-plugin-ionic-angular
[DEBUG] !!! ERROR ENCOUNTERED !!!
TypeError: AppScripts.processPageRequest is not a function
[DEBUG] TypeError: AppScripts.processPageRequest is not a function
at Object.
(/Users/user/App/node_modules/@ionic/cli-plugin-ionic-angular/dist/generate.js:38:41)
at Generator.next (<anonymous>)
at fulfilled
(/Users/user/App/node_modules/@ionic/cli-plugin-ionic-angular/dist/generate.js:4:58)
at <anonymous>
$ ionic info
的package.json:
global packages:
@ionic/cli-utils : 1.4.0
Cordova CLI : 6.5.0
Ionic CLI : 3.4.0
local packages:
@ionic/app-scripts : https://registry.npmjs.org/@ionic/app-scripts/-/app-scripts-1.1.4.tgz
@ionic/cli-plugin-cordova : 1.4.0
@ionic/cli-plugin-ionic-angular : 1.3.1
Cordova Platforms : android 6.1.2 ios 4.1.1
Ionic Framework : ionic-angular https://registry.npmjs.org/ionic-angular/-/ionic-angular-2.3.0.tgz
System:
Node : v8.1.3
OS : macOS Sierra
Xcode : Xcode 8.3.3 Build version 8E3004b
ios-deploy : 1.9.1
ios-sim : 5.0.13
npm : 5.0.3
感谢任何和所有帮助!
答案 0 :(得分:6)
感谢suraj,我研究了将应用脚本更新为@latest:
$ npm install @ionic/app-scripts@latest
这警告说fsevents和打字稿不兼容,所以我更新了这些:
$ npm install fsevents@latest && npm install typescript@latest
尝试再次更新应用脚本以验证警告消失
$ npm install @ionic/app-scripts@latest
这失败了,所以我吹掉了node_modules并重新编写了npm install
$ rm -rf node_modules/
$ npm install
中提琴!我可以ionic generate page
$ ionic g page MyPage --verbose
[DEBUG] Loading global plugin @ionic/cli-plugin-proxy
[DEBUG] Throwing PLUGIN_NOT_INSTALLED for global @ionic/cli-plugin-proxy
[DEBUG] Loading local plugin @ionic/cli-plugin-cordova
[DEBUG] Loading local plugin @ionic/cli-plugin-ionic-angular
[OK] Generated a page named MyPage!
不幸的是,这现在因{1}}而导致错误:
ionic serve
关注advice here我将typescript: node_modules/ionic-angular/navigation/nav-controller-base.d.ts, line: 20
Class 'NavControllerBase' incorrectly implements interface 'NavController'. Types of property 'popTo' are
incompatible. Type '(indexOrViewCtrl: any, opts?: NavOptions, done?: Function) => Promise<any>' is not
assignable to type '(page: any, params?: any, opts?: NavOptions, done?: Function) => Promise<any>'. Types of
parameters 'done' and 'opts' are incompatible. Type 'NavOptions' is not assignable to type 'Function'.
Property 'apply' is missing in type 'NavOptions'.
L20: export declare class NavControllerBase extends Ion implements NavController {
L21: parent: any;
typescript: node_modules/rxjs/Subject.d.ts, line: 16
Class 'Subject<T>' incorrectly extends base class 'Observable<T>'. Types of property 'lift' are
incompatible. Type '<R>(operator: Operator<T, R>) => Observable<T>' is not assignable to type '<R>(operator:
Operator<T, R>) => Observable<R>'. Type 'Observable<T>' is not assignable to type 'Observable<R>'. Type 'T'
is not assignable to type 'R'.
L16: export declare class Subject<T> extends Observable<T> implements ISubscription {
L17: observers: Observer<T>[];
降级为typescript@2.3.4,现在npm install typescript@2.3.4
和ionic serve
工作。呼!