无法在离子 3 中使用日期选择器

Unable to use date picker in ionic 3

我正在尝试在我的 ionic 3 应用程序中使用 ngx 日期选择器,但我遇到了这些错误

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:1 Failed to load resource: the server responded with a status of 404 (Not Found)
main.js:1 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:1 Failed to load resource: the server responded with a status of 404 (Not Found)
main.js:1 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.

我的Package.json是

{
  "name": "HelloWorld",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "start": "ionic-app-scripts serve",
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "lint": "ionic-app-scripts lint"
  },
  "dependencies": {
    "@angular/animations": "^5.2.11",
    "@angular/cdk": "5.2.4",
    "@angular/common": "5.2.11",
    "@angular/compiler": "5.2.11",
    "@angular/compiler-cli": "5.2.11",
    "@angular/core": "5.2.11",
    "@angular/http": "5.2.11",
    "@angular/material": "^8.1.4",
    "@angular/platform-browser": "5.2.11",
    "@angular/platform-browser-dynamic": "5.2.11",
    "@ionic-native/core": "~4.17.0",
    "@ionic-native/geolocation": "^4.18.0",
    "@ionic-native/splash-screen": "~4.17.0",
    "@ionic-native/status-bar": "~4.17.0",
    "@ionic/storage": "2.2.0",
    "cordova-plugin-geolocation": "4.0.1",
    "ionic-angular": "3.9.2",
    "ionicons": "3.0.0",
    "ng-pick-datetime": "^7.0.0",
    "rxjs": "5.5.11",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.26"
  },
  "devDependencies": {
    "@angular/forms": "^5.2.11",
    "@ionic/app-scripts": "3.2.0",
    "typescript": "~2.6.2"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-geolocation": {}
    }
  }
}

我认为这与版本不兼容有关,但我无法确定是哪个软件包导致的。 任何帮助将不胜感激。

我,Reading-The-Documentation-Man,通过使用我的超级英雄能力,推断出您正在使用 Angular 5.

有一个 note right at the top 说明您需要与该软件包一起使用哪个版本:

The picker has been updated for Angular 6+ apps. If you are still using Angular 5, you should install the picker version 5.2.6. npm install ng-pick-datetime@5.2.6 --save

但是你的包裹上写着你使用的是犯罪性高"ng-pick-datetime": "^7.0.0",

改变你的方式,回到光明中。

祝市民发展顺利!

更新

并且不要忘记 follow the setup guide for that specific version,因为 Ionic 4 中的情况发生了很大变化。