TypeErrpr:无法读取未定义的属性“包含”

时间:2017-05-15 13:37:42

标签: javascript ionic-framework ionic2

所以基本上,我正处于一个Ionic项目中,两周前我们成功地将其迁移到了3.0.0测试版,或多或少。一切都运转正常,我可以毫无问题地发展它。

但今天早上,我使用的是Ionic 3 beta CLI,并尝试安装ConnectivityService。它无法在那个版本中运行,所以我执行了一个干净的离子卸载,然后,一个针对离子@ latest的新安装。它给应用程序脚本带来了依赖性错误,因此我使用了以下命令:

npm install --save @ ^ 1.3.1

然后,我再次使用“npm install -g ionic @ latest”。之后,一切都停止了。我不能再对离子做任何事了;我只是继续犯同样的错误:“TypeErrpr:无法读取属性'包括'未定义的'”。如果我卸载并重新安装它并不重要;我无法让它发挥作用。

你知道这可能导致什么吗?

编辑:这是我的package.json文件:

   {
  "name": "myApp",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "ionic:build": "ionic-app-scripts build",
    "ionic:serve": "ionic-app-scripts serve"
  },
  "dependencies": {
    "@angular/common": "4.0.0",
    "@angular/compiler": "4.0.0",
    "@angular/compiler-cli": "4.0.0",
    "@angular/core": "4.0.0",
    "@angular/forms": "4.0.0",
    "@angular/http": "4.0.0",
    "@angular/platform-browser": "4.0.0",
    "@angular/platform-browser-dynamic": "4.0.0",
    "@ionic-native/core": "3.4.2",
    "@ionic-native/splash-screen": "^3.5.0",
    "@ionic-native/status-bar": "3.4.2",
    "@ionic/app-scripts": "^1.3.1",
    "@ionic/storage": "2.0.1",
    "cordova-plugin-whitelist": "^1.3.1",
    "image-manipulation": "0.0.4",
    "ionic-angular": "3.0.1",
    "ionicons": "3.0.0",
    "parse": "^1.9.2",
    "rxjs": "5.1.1",
    "sw-toolbox": "3.4.0",
    "zone.js": "^0.8.4"
  },
  "devDependencies": {
    "@ionic/app-scripts": "1.3.0",
    "typescript": "~2.2.1",
    "@ionic/cli-plugin-cordova": "0.0.12",
    "@ionic/cli-plugin-ionic-angular": "0.0.6"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-whitelist": {}
    }
  }
}

1 个答案:

答案 0 :(得分:0)

您的npm套餐已过期。我建议安装npm-check-updates,然后使用' ncu -u'更新您的package.json文件。