我被困在我的角度火-2离线/ionic3应用程序上。 当我尝试将我的应用程序上传到 Ionic View 时,它一直给我这个错误。 当我为 Android 构建或使用 Ionic Lab 时,它没有错误。
我看到其他人有一个填充问题,他们建议这样做:
npm install promise-polyfill --save-exact
但它对我不起作用,错误仍然存在。 这些是我的版本(package.json(:
"Firebase": "^4.3.0", "Angularfire2": "^4.0.0-rc0", "Angularfire2-offline": "^4.2.4",
Error: ./node_modules/firebase/utils/promise.js Module not found: Error: Can't resolve 'promise-polyfill' in
remote: '/usr/src/app/node_modules/firebase/utils' resolve 'promise-polyfill' in
remote: '/usr/src/app/node_modules/firebase/utils' Parsed request is a module using description file:
remote: /usr/src/app/node_modules/firebase/package.json (relative path: ./utils) Field 'browser' doesn't contain a
remote: valid alias configuration after using description file: /usr/src/app/node_modules/firebase/package.json
remote: (relative path: ./utils) resolve as module looking for modules in /usr/src/app/node_modules using
remote: description file: /usr/src/app/package.json (relative path: ./node_modules) Field 'browser' doesn't contain
remote: a valid alias configuration after using description file: /usr/src/app/package.json (relative path:
remote: ./node_modules) using description file: /usr/src/app/package.json (relative path:
remote: ./node_modules/promise-polyfill) no extension Field 'browser' doesn't contain a valid alias configuration
remote: /usr/src/app/node_modules/promise-polyfill doesn't exist .ts Field 'browser' doesn't contain a valid alias
remote: configuration /usr/src/app/node_modules/promise-polyfill.ts doesn't exist .js Field 'browser' doesn't
remote: contain a valid alias configuration /usr/src/app/node_modules/promise-polyfill.js doesn't exist .json Field
remote: 'browser' doesn't contain a valid alias configuration /usr/src/app/node_modules/promise-polyfill.json
remote: doesn't exist as directory /usr/src/app/node_modules/promise-polyfill doesn't exist
remote: [/usr/src/app/node_modules/promise-polyfill] [/usr/src/app/node_modules/promise-polyfill.ts]
remote: [/usr/src/app/node_modules/promise-polyfill.js] [/usr/src/app/node_modules/promise-polyfill.json]
remote: [/usr/src/app/node_modules/promise-polyfill] @ ./node_modules/firebase/utils/promise.js 14:76-103 @
remote: ./node_modules/firebase/app/firebase_app.js @ ./node_modules/firebase/app.js @
remote: ./node_modules/firebase/firebase-browser.js @ ./src/providers/camera/camera.ts @ ./src/app/app.module.ts @
remote: ./src/app/main.ts
npm install angularfire2 firebase promise-polyfill --save
Angularfire2 更新了他们的文档。
https://github.com/angular/angularfire2/blob/master/docs/Auth-with-Ionic3-Angular4.md
将 angularfire2 安装到我的应用程序后,我遇到了完全相同的错误; 仅在将代码推送到 Ionic Pro 平台时。 首先,我也为ios构建了错误,通过将angularfire2更新到另一个版本而逃脱了:
npm i --save angularfire2@4.0.0-rc.1
也许你可以试试?