cordova - 找不到模块'@angular/core' + ionic 3
问题描述
角度/核心实际上是在正确的位置。这是我第一次面对这个问题。在这种情况下该怎么办?
我已经开始遇到与 FCM(Firebase 云消息传递)集成的问题
这是我的package.json
添加了 "angularfire2": "^5.0.0-rc.6.0",
相同的错误:无法复制这个是离子输出
所以,我降级了
从 :
"angularfire2": "^5.0.0-rc.6.0"
至 :
"angularfire2": "5.0.0-rc.3",
和,
从 :
"firebase": "^4.13.1",
至 :
"firebase": "^4.6.0",
==================================================== ====
{
"name": "authNotificationTest",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"dependencies": {
"@angular/animations": "5.2.10",
"@angular/common": "5.2.10",
"@angular/compiler": "5.2.10",
"@angular/compiler-cli": "5.2.10",
"@angular/core": "5.2.10",
"@angular/forms": "5.2.10",
"@angular/http": "5.2.10",
"@angular/platform-browser": "5.2.10",
"@angular/platform-browser-dynamic": "5.2.10",
"@ionic-native/core": "4.7.0",
"@ionic-native/fcm": "^4.7.0",
"@ionic-native/firebase": "^4.7.0",
"@ionic-native/splash-screen": "4.7.0",
"@ionic-native/status-bar": "4.7.0",
"@ionic/storage": "2.1.3",
"angularfire2": "^5.0.0-rc.6.0",
"cordova-browser": "5.0.3",
"cordova-ios": "4.5.4",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-fcm": "^2.1.2",
"cordova-plugin-fcm-plus": "git+https://github.com/guyromb/cordova-plugin-fcm-plus.git",
"cordova-plugin-firebase": "^1.0.2",
"cordova-plugin-ionic-keyboard": "^2.0.5",
"cordova-plugin-ionic-webview": "^1.2.1",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-whitelist": "^1.3.3",
"firebase": "^4.13.1",
"ionic-angular": "3.9.2",
"ionicons": "3.0.0",
"rxjs": "5.5.10",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.26"
},
"devDependencies": {
"@ionic/app-scripts": "3.1.9",
"typescript": "~2.6.2"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"cordova-plugin-fcm": {},
"cordova-plugin-firebase": {},
"cordova-plugin-whitelist": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-ionic-webview": {},
"cordova-plugin-ionic-keyboard": {}
}
}
}
这是我的离子信息:
cli 包:(/usr/local/lib/node_modules)
@ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
全局包:
cordova (Cordova CLI) : 8.0.0
本地包:
@ionic/app-scripts : 3.1.9
Cordova Platforms : browser 5.0.3 ios 4.5.4
Ionic Framework : ionic-angular 3.9.2
系统:
Node : v9.11.1
npm : 5.6.0
OS : macOS High Sierra
Xcode : Xcode 9.3 Build version 9E145
环境变量:
ANDROID_HOME : not set
杂项:
backend : pro
错误日志:
当我运行离子科尔多瓦运行浏览器
Refused to apply style from 'http://localhost:8100/build/main.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
vendor.js Failed to load resource: the server responded with a status of 404 (Not Found)
main.js Failed to load resource: the server responded with a status of 404 (Not Found)
vendor.js Failed to load resource: the server responded with a status of 404 (Not Found)
(index):1 Refused to execute script from 'http://localhost:8100/build/vendor.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
main.js Failed to load resource: the server responded with a status of 404 (Not Found)
(index):1 Refused to execute script from 'http://localhost:8100/build/main.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
(index):1 Refused to apply style from 'http://localhost:8100/build/main.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
当我运行离子服务时
而且,这是来自控制台:
Refused to apply style from 'http://localhost:8100/build/main.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
vendor.js Failed to load resource: the server responded with a status of 404 (Not Found)
main.js Failed to load resource: the server responded with a status of 404 (Not Found)
(index):1 Refused to apply style from 'http://localhost:8100/build/main.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
vendor.js Failed to load resource: the server responded with a status of 404 (Not Found)
(index):1 Refused to execute script from 'http://localhost:8100/build/vendor.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
main.js Failed to load resource: the server responded with a status of 404 (Not Found)
(index):1 Refused to execute script from 'http://localhost:8100/build/main.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
(index):1 Refused to apply style from 'http://localhost:8100/build/main.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
解决方案
感谢 Suraj Rao 的评论,您可以在这里找到问题的解决方案: “FirebaseApp 未正确实现”,如下面的屏幕截图所示
请参阅此线程以获取更多详细信息::github.com/angular/angularfire2/issues/1385
回滚"firebase": "4.8.0"
有助于解决上述问题
推荐阅读
- ios - UniversalLink 在 iOS 14 设备中不起作用
- qemu - 如何通过 2 个不同的 PCI 端口访问同一个硬件设备
- java - 创建数组
从 xml 文件 - wordpress - Wordpress 网站每一分钟重复加载一次
- javascript - 如何在剃刀视图上使用基于模型值的条件 JavaScript 语句?
- python - python seaborn函数'displot'不显示标题的一部分
- javascript - 新的 FormData 返回空对象
- pandas - Pandas - 打印数据时显示所有列(4列数据框)
- linux - 在什么情况下 dma_alloc_coherent() 函数的 *dma_handle 返回物理地址?
- sql-server - Debezium 仅在启动时报告更改事件