gpt4 book ai didi

node.js - ionic 2 构建类型错误 : Cannot read property 'AssetUrl' of undefined

转载 作者:搜寻专家 更新时间:2023-11-01 00:12:36 25 4
gpt4 key购买 nike

Ionic 2 失败的 CLI 构建 给我以下错误:“TypeError:无法读取未定义的属性‘AssetUrl’”。

我的研究让我找到了 this threadthis one .

两个线程都建议修改“package.json”文件,去掉“dependencies”和“devDependencies”中版本前的“^”符号。

我这样做了,然后是 CLI:

  • ionic rm 平台 android
  • ionic 添加平台 android
  • 最后:ionic build android

我仍然遇到同样的错误。

this thread 的某个时刻,它建议使用一些我还不熟悉的 npm 命令,引用它:“rm -rf node_modules and npm cache clean and a fresh npm install”。 我真的不明白这一切的背后是什么

如果有人想出神奇的解决方案使构建运行良好,我将不胜感激。但我也想了解如何将“TypeError:无法读取未定义的属性‘AssetUrl’”与“package.json”联系起来?我不明白为什么这个错误会导致那个可能的解决方案。

我的版本是:npm 3.10.3 Node 6.7.0 Cordova 6.3.1 ionic 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": []
}

最佳答案

我在项目文件夹中的 CLI 中做了一个“npm install”+ 去掉 package.json 中“dependencies”和“devDependencies”前面的“^”符号(如链接在我的问题)。它解决了这个问题。

关于node.js - ionic 2 构建类型错误 : Cannot read property 'AssetUrl' of undefined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40206774/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com