Ionic 2 Build TypeError:无法读取未定义的属性'AssetUrl'

nyl*_*uje 2 node.js npm ionic2

Ionic 2 CLI构建失败,给出了以下错误:"TypeError:无法读取未定义的属性'AssetUrl'".

我的研究引导我到这个线程这一个.

两个线程都建议修改"package.json"文件并删除"dependencies"和"devDependencies"中版本前面的"^"符号.

我这样做然后CLI:

  • 离子rm平台android
  • 离子添加平台android
  • 最后:离子构建android

我仍然得到同样的错误.

这个线程的某个时刻,它建议使用一些我不熟悉的npm命令,引用它:"rm -rf node_modules和npm cache clean以及新的npm install".我真的不明白这一切是什么.

如果有人拿出神奇的解决方案来让构建运行正常,我将不胜感激.但我还想了解"TypeError:无法读取未定义的属性'AssetUrl'"是如何与"package.json"链接的?我不明白为什么这个错误会导致这种可能的解决方案.

我的版本是:npm 3.10.3节点6.7.0 cordova 6.3.1离子2.1.0

这是我的package.json,因为它现在看起来更像是在两个线程中操作建议读取:

{
  "name": "ionic-hello-world",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "build": "ionic-app-scripts build",
    "watch": "ionic-app-scripts watch",
    "serve:before": "watch",
    "emulate:before": "build",
    "deploy:before": "build",
    "build:before": "build",
    "run:before": "build"
  },
  "dependencies": {
    "@angular/common": "2.0.0",
    "@angular/compiler": "2.0.0",
    "@angular/compiler-cli": "0.6.2",
    "@angular/core": "2.0.0",
    "@angular/forms": "2.0.0",
    "@angular/http": "2.0.0",
    "@angular/platform-browser": "2.0.0",
    "@angular/platform-browser-dynamic": "2.0.0",
    "@angular/platform-server": "2.0.0",
    "ionic-angular": "2.0.0-rc.0",
    "ionicons": "3.0.0",
    "@ionic/storage": "1.0.3",
    "ionic-native": "2.0.3",
    "rxjs": "5.0.0-beta.12",
    "zone.js": "0.6.21"
  },
  "devDependencies": {
    "@ionic/app-scripts": "0.0.36",
    "typescript": "2.0.3"
  },
  "description": "HelloWorld: An Ionic project",
  "cordovaPlugins": [
    "cordova-plugin-device",
    "cordova-plugin-console",
    "cordova-plugin-whitelist",
    "cordova-plugin-splashscreen",
    "cordova-plugin-statusbar",
    "ionic-plugin-keyboard"
  ],
  "cordovaPlatforms": []
}
Run Code Online (Sandbox Code Playgroud)

nyl*_*uje 6

我在projet的文件夹中的CLI中执行了"npm install"+在package.json中的"dependencies"和"devDependencies"前面删除"^"符号(在我的问题中链接的论坛帖子中建议) .它解决了它.