简体   繁体   English

当我部署 - 加载资源失败:服务器响应状态为 404 ()

[英]When I deploy - Failed to load resource: the server responded with a status of 404 ()

Webpage error网页错误

<!-- Scripts -->
<script src="node_modules/jquery/dist/jquery.slim.min.js"></script>
<script src="node_modules/popper.js/dist/umd/popper.min.js"></script>
<script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="js/scripts.js"></script>

I am not sure how get my css, bootstrap, and popper to display on the webpage when deployed.我不确定如何让我的 css、引导程序和弹出程序在部署时显示在网页上。 It works fine on local.它在本地运行良好。

When you publish your site you don't have the node_modules folder on the server, don't worry you shouldn't have it there.当您发布您的站点时,您的服务器上没有 node_modules 文件夹,不用担心您不应该有它。 Replace the node_modules with cdn links instead.将 node_modules 替换为 cdn 链接。 You will find alot of cdn sources on cdnjs.com, but a few libraries have their own (like bootstrap), here is jquery for example https://cdnjs.com/libraries/jquery .您会在 cdnjs.com 上找到很多 cdn 资源,但一些库有自己的(如引导程序),这里是 jquery 例如Z5E056C500A1C4B6A7110B50D807BADE//cdquery.njs .

<!-- My links -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" />

<!-- Scripts -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 加载资源失败:服务器响应状态为 404() - Failed to load resource: the server responded with a status of 404 () 加载资源失败:服务器响应状态为404 - Failed to load resource: the server responded with a status of 404 无法加载资源:服务器响应状态为404? 资源问题 - Failed to load resource: the server responded with a status of 404 ? Resource issue 程序无法加载无法加载资源:服务器以404(未找到)状态响应 - Program will not load Failed to load resource: the server responded with a status of 404 (Not Found) Node.js服务器:无法加载资源:服务器以状态404(未找到)响应 - Nodejs server: Failed to load resource: the server responded with a status of 404 (Not Found) 加载资源失败:服务器响应状态为 404(未找到)? - Failed to load resource: the server responded with a status of 404 (Not Found)? 加载资源失败:服务器响应状态为404(未找到) - getting Failed to load resource: the server responded with a status of 404 (Not Found) 加载资源失败:服务器响应状态为404() SpringBoot - Failed to load resource: the server responded with a status of 404 () SpringBoot 加载资源失败:服务器响应状态为404()Controller.js:1 - Failed to load resource: the server responded with a status of 404 () Controller.js:1 Rails ajax:无法加载资源:服务器以状态404(未找到)响应 - Rails ajax: Failed to load resource: the server responded with a status of 404 (Not Found)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM