gpt4 book ai didi

asp.net-core - SystemJS(带有 jspm 的 Aurelia)无法从 jspm_packages 文件夹加载 "aurelia-pal-browser"

转载 作者:行者123 更新时间:2023-12-02 02:49:32 28 4
gpt4 key购买 nike

我已按照 https://www.danylkoweb.com/Blog/getting-started-with-aurelia-in-aspnet-mvc-EH 中的说明进行操作,步骤 3-5 将 Aurelia 安装到我的 asp.net mvc 核心应用程序中(即运行 npm install、jspm init、jspm install aurelia-framework 和 jspm install aurelia-bootstrapper)。

我的“启动代码”现在看起来像这样:

<script src="jspm_packages/system.js"></script>
<script src="config.js"></script>
<script>
SystemJS.import('aurelia-bootstrapper');
</script>

当我运行应用程序时,我可以在 Chrome 开发工具上看到/jspm_packages/npm 文件夹下加载了大量 Aurelia 资源(js 文件),但我也收到如下错误:

Uncaught (in promise) Error: (SystemJS) XHR error (404 Not Found) loading http://localhost:39535/aurelia-pal-browser.js Error: XHR error (404 Not Found) loading http://localhost:39535/aurelia-pal-browser.js Error loading http://localhost:39535/aurelia-pal-browser.js

出于某种原因,SystemJS 开始在我的应用程序的根目录中查找 aurelia-pal-browser.js。我想它找不到 jspm_packages\npm\aurelia-pal-browser@1.1.0 文件夹,但它在那里,并且我在 config.js 文件中有相同的版本号。

运行 jspm 命令后得到的完整 config.js:

System.config({
baseURL: "/",
defaultJSExtensions: true,
transpiler: false,
paths: {
"npm:*": "jspm_packages/npm/*"
},

map: {
"aurelia-bootstrapper": "npm:aurelia-bootstrapper@2.0.1",
"aurelia-framework": "npm:aurelia-framework@1.0.8",
"npm:aurelia-binding@1.1.1": {
"aurelia-logging": "npm:aurelia-logging@1.2.0",
"aurelia-metadata": "npm:aurelia-metadata@1.0.3",
"aurelia-pal": "npm:aurelia-pal@1.2.0",
"aurelia-task-queue": "npm:aurelia-task-queue@1.1.0"
},
"npm:aurelia-bootstrapper@2.0.1": {
"aurelia-event-aggregator": "npm:aurelia-event-aggregator@1.0.1",
"aurelia-framework": "npm:aurelia-framework@1.0.8",
"aurelia-history": "npm:aurelia-history@1.0.0",
"aurelia-history-browser": "npm:aurelia-history-browser@1.0.0",
"aurelia-loader-default": "npm:aurelia-loader-default@1.0.0",
"aurelia-logging-console": "npm:aurelia-logging-console@1.0.0",
"aurelia-pal": "npm:aurelia-pal@1.2.0",
"aurelia-pal-browser": "npm:aurelia-pal-browser@1.1.0",
"aurelia-polyfills": "npm:aurelia-polyfills@1.1.1",
"aurelia-router": "npm:aurelia-router@1.1.1",
"aurelia-templating": "npm:aurelia-templating@1.1.4",
"aurelia-templating-binding": "npm:aurelia-templating-binding@1.1.0",
"aurelia-templating-resources": "npm:aurelia-templating-resources@1.2.0",
"aurelia-templating-router": "npm:aurelia-templating-router@1.0.1"
},
"npm:aurelia-dependency-injection@1.2.1": {
"aurelia-metadata": "npm:aurelia-metadata@1.0.3",
"aurelia-pal": "npm:aurelia-pal@1.2.0"
},
"npm:aurelia-event-aggregator@1.0.1": {
"aurelia-logging": "npm:aurelia-logging@1.2.0"
},
"npm:aurelia-framework@1.0.8": {
"aurelia-binding": "npm:aurelia-binding@1.1.1",
"aurelia-dependency-injection": "npm:aurelia-dependency-injection@1.2.1",
"aurelia-loader": "npm:aurelia-loader@1.0.0",
"aurelia-logging": "npm:aurelia-logging@1.2.0",
"aurelia-metadata": "npm:aurelia-metadata@1.0.3",
"aurelia-pal": "npm:aurelia-pal@1.2.0",
"aurelia-path": "npm:aurelia-path@1.1.1",
"aurelia-task-queue": "npm:aurelia-task-queue@1.1.0",
"aurelia-templating": "npm:aurelia-templating@1.1.4"
},
"npm:aurelia-history-browser@1.0.0": {
"aurelia-history": "npm:aurelia-history@1.0.0",
"aurelia-pal": "npm:aurelia-pal@1.2.0"
},
"npm:aurelia-loader-default@1.0.0": {
"aurelia-loader": "npm:aurelia-loader@1.0.0",
"aurelia-metadata": "npm:aurelia-metadata@1.0.3",
"aurelia-pal": "npm:aurelia-pal@1.2.0"
},
"npm:aurelia-loader@1.0.0": {
"aurelia-metadata": "npm:aurelia-metadata@1.0.3",
"aurelia-path": "npm:aurelia-path@1.1.1"
},
"npm:aurelia-logging-console@1.0.0": {
"aurelia-logging": "npm:aurelia-logging@1.2.0"
},
"npm:aurelia-metadata@1.0.3": {
"aurelia-pal": "npm:aurelia-pal@1.2.0"
},
"npm:aurelia-pal-browser@1.1.0": {
"aurelia-pal": "npm:aurelia-pal@1.2.0"
},
"npm:aurelia-polyfills@1.1.1": {
"aurelia-pal": "npm:aurelia-pal@1.2.0"
},
"npm:aurelia-route-recognizer@1.1.0": {
"aurelia-path": "npm:aurelia-path@1.1.1"
},
"npm:aurelia-router@1.1.1": {
"aurelia-dependency-injection": "npm:aurelia-dependency-injection@1.2.1",
"aurelia-event-aggregator": "npm:aurelia-event-aggregator@1.0.1",
"aurelia-history": "npm:aurelia-history@1.0.0",
"aurelia-logging": "npm:aurelia-logging@1.2.0",
"aurelia-path": "npm:aurelia-path@1.1.1",
"aurelia-route-recognizer": "npm:aurelia-route-recognizer@1.1.0"
},
"npm:aurelia-task-queue@1.1.0": {
"aurelia-pal": "npm:aurelia-pal@1.2.0"
},
"npm:aurelia-templating-binding@1.1.0": {
"aurelia-binding": "npm:aurelia-binding@1.1.1",
"aurelia-logging": "npm:aurelia-logging@1.2.0",
"aurelia-templating": "npm:aurelia-templating@1.1.4"
},
"npm:aurelia-templating-resources@1.2.0": {
"aurelia-binding": "npm:aurelia-binding@1.1.1",
"aurelia-dependency-injection": "npm:aurelia-dependency-injection@1.2.1",
"aurelia-loader": "npm:aurelia-loader@1.0.0",
"aurelia-logging": "npm:aurelia-logging@1.2.0",
"aurelia-metadata": "npm:aurelia-metadata@1.0.3",
"aurelia-pal": "npm:aurelia-pal@1.2.0",
"aurelia-path": "npm:aurelia-path@1.1.1",
"aurelia-task-queue": "npm:aurelia-task-queue@1.1.0",
"aurelia-templating": "npm:aurelia-templating@1.1.4"
},
"npm:aurelia-templating-router@1.0.1": {
"aurelia-binding": "npm:aurelia-binding@1.1.1",
"aurelia-dependency-injection": "npm:aurelia-dependency-injection@1.2.1",
"aurelia-logging": "npm:aurelia-logging@1.2.0",
"aurelia-metadata": "npm:aurelia-metadata@1.0.3",
"aurelia-pal": "npm:aurelia-pal@1.2.0",
"aurelia-path": "npm:aurelia-path@1.1.1",
"aurelia-router": "npm:aurelia-router@1.1.1",
"aurelia-templating": "npm:aurelia-templating@1.1.4"
},
"npm:aurelia-templating@1.1.4": {
"aurelia-binding": "npm:aurelia-binding@1.1.1",
"aurelia-dependency-injection": "npm:aurelia-dependency-injection@1.2.1",
"aurelia-loader": "npm:aurelia-loader@1.0.0",
"aurelia-logging": "npm:aurelia-logging@1.2.0",
"aurelia-metadata": "npm:aurelia-metadata@1.0.3",
"aurelia-pal": "npm:aurelia-pal@1.2.0",
"aurelia-path": "npm:aurelia-path@1.1.1",
"aurelia-task-queue": "npm:aurelia-task-queue@1.1.0"
}
}
});

最佳答案

我没有阅读您链接的文章,但您可以尝试将 aurelia-pal-browser@1.1.0 安装为依赖项,以便它在您的包中明确列出.json 和您的 config.js

只需在命令行上执行以下命令:

jspm install npm:aurelia-pal-browser

关于asp.net-core - SystemJS(带有 jspm 的 Aurelia)无法从 jspm_packages 文件夹加载 "aurelia-pal-browser",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41522750/

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