我在app上工作了很长时间,最后我需要少量使用firebase,所以我使用npm install angularfire2 firebase --save
安装了它,
并按照以下步骤操作:steps,
firebase对我很有用,但是当我准备在我的设备上运行时,我在ionic cordova run android
Error occurred during command execution from a CLI plugin (@ionic/cli-plugin-cordova). Your plugins may be out of
date.
Error: ./~/firebase/app/shared_promise.js
Module not found: Error: Can't resolve 'promise-polyfill' in 'J:\Ionic2\Driver2\Driver\node_modules\firebase\app'
resolve 'promise-polyfill' in 'J:\Ionic2\Driver2\Driver\node_modules\firebase\app'
Parsed request is a module
using description file: J:\Ionic2\Driver2\Driver\node_modules\firebase\package.json (relative path: ./app)
Field 'browser' doesn't contain a valid alias configuration
after using description file: J:\Ionic2\Driver2\Driver\node_modules\firebase\package.json (relative path: ./app)
resolve as module
looking for modules in J:\Ionic2\Driver2\Driver\node_modules
using description file: J:\Ionic2\Driver2\Driver\package.json (relative path: ./node_modules)
Field 'browser' doesn't contain a valid alias configuration
after using description file: J:\Ionic2\Driver2\Driver\package.json (relative path: ./node_modules)
using description file: J:\Ionic2\Driver2\Driver\package.json (relative path: ./node_modules/promise-polyfill)
as directory
J:\Ionic2\Driver2\Driver\node_modules\promise-polyfill doesn't exist
no extension
Field 'browser' doesn't contain a valid alias configuration
J:\Ionic2\Driver2\Driver\node_modules\promise-polyfill doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
J:\Ionic2\Driver2\Driver\node_modules\promise-polyfill.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
J:\Ionic2\Driver2\Driver\node_modules\promise-polyfill.js doesn't exist
.json
Field 'browser' doesn't contain a valid alias configuration
J:\Ionic2\Driver2\Driver\node_modules\promise-polyfill.json doesn't exist
[J:\Ionic2\Driver2\Driver\node_modules\promise-polyfill]
[J:\Ionic2\Driver2\Driver\node_modules\promise-polyfill]
[J:\Ionic2\Driver2\Driver\node_modules\promise-polyfill.ts]
[J:\Ionic2\Driver2\Driver\node_modules\promise-polyfill.js]
[J:\Ionic2\Driver2\Driver\node_modules\promise-polyfill.json]
@ ./~/firebase/app/shared_promise.js 38:35-62
@ ./~/firebase/app/firebase_app.js
@ ./~/firebase/app.js
@ ./~/firebase/database.js
@ ./~/angularfire2/database/firebase_list_factory.js
@ ./~/angularfire2/database.js
@ ./src/app/app.module.ts
@ ./src/app/main.ts
我的离子信息是:
global packages:
@ionic/cli-utils : 1.4.0
Cordova CLI : 7.0.1
Ionic CLI : 3.4.0
local packages:
@ionic/app-scripts : 1.3.6
@ionic/cli-plugin-cordova : 1.4.0
@ionic/cli-plugin-ionic-angular : 1.3.1
Cordova Platforms : android 6.2.3
Ionic Framework : ionic-angular 3.1.1
System:
Node : v6.10.3
OS : Windows 10
Xcode : not installed
ios-deploy : not installed
ios-sim : not installed
npm : 3.10.10
答案 0 :(得分:1)
我想在找到答案后分享答案: 这解决了我的问题https://github.com/ionic-team/ionic-app-scripts/issues/1001#issuecomment-302993092
npm install promise-polyfill --save-exact