Я работал над приложением долгое время, и в конце мне потребовалось небольшое использование firebase, поэтому я установил его с помощью npm install angularfire2 firebase --save, и выполнил следующие шаги: шаги < / а>, 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
To Be 26 Июн 2017 в 08:11

1 ответ

Лучший ответ

Я хочу поделиться ответом после того, как найду его: это решило мою проблему https://github.com/ ionic-team / ionic-app-scripts / issues / 1001 # issuecomment-302993092

npm install promise-polyfill --save-exact
1
To Be 8 Июл 2017 в 14:48