找不到路径文件

Path file not found

我正尝试在 Jekyll 中使用一些 jQuery 代码,但我的控制台出现此错误:

[2020-11-18 15:15:40] ERROR '/node_modules/jquery/dist/jquery.min.js' not found.
[2020-11-18 15:15:40] ERROR '/node_modules/popper.js/dist/umd/popper.min.js' not found.

这是我的代码:

<script src="{{'/node_modules/jquery/dist/jquery.min.js' | prepend: site.baseurl}}"></script>
<script src="{{'/node_modules/popper.js/dist/umd/popper.min.js' | prepend: site.baseurl}}"></script>

我也试过:

<script src="{{'../node_modules/jquery/dist/jquery.min.js' | prepend: site.baseurl}}"></script>
<script src="{{'../node_modules/popper.js/dist/umd/popper.min.js' | prepend: site.baseurl}}"></script>

我的配置文件:

# Site settings
# http://jekyllrb.com/docs/configuration/
title: Datalab Project
email: meryem.achemlal@alterway.fr
description:  Datalab Project
baseurl: "" # the subpath of your site, e.g. /blog/
url: "" # the base hostname & protocol for your site
# twitter_username: tweetpressfr
github_username:  mery92

# Build settings
markdown: kramdown
sass:
    load_paths:
        - _sass
        - node_modules
        - assets/css
exclude: []

也请看截图

enter image description here

enter image description here

<script> 标签移动到部分而不是 <body> 部分。

您的问题可能与 jQuery 查找 javascript 资源或资源顺序有关。