mirror of
https://gitcode.com/huyuchengus/gitcode_knowledge.git
synced 2025-07-14 04:33:29 +00:00
备份博文内容
This commit is contained in:
parent
85602f991a
commit
026b043ecc
@ -0,0 +1 @@
|
||||
<p>构建的错误信息如下:</p> <br><p></p> <br><pre><code>09:52:57.975 ➤ YN0000: · Done with warnings in 3s 120ms<br>09:52:58.072 Executing user command: npm run build<br>09:52:58.817 npm ERR! Missing script: "build"<br>09:52:58.818 npm ERR! <br>09:52:58.818 npm ERR! To see a list of scripts, run:<br>09:52:58.818 npm ERR! npm run<br>09:52:58.818 <br>09:52:58.819 npm ERR! A complete log of this run can be found in: /opt/buildhome/.npm/_logs/2025-04-10T13_52_58_752Z-debug-0.log<br>09:52:58.825 Failed: Error while executing user command. Exited with error code: 1<br></code></pre> <br><p></p> <br><p></p> <br><p class="img-center"><a href="https://cdn.isharkfly.com/com-isharkfly-www/discourse-uploads/original/3X/e/8/e83176bd5760e0d560d86b20d0e67b8cc4ab6239.jpeg" rel="nofollow"><img alt="2025-04-11_10-26-25" height="500" src="https://i-blog.csdnimg.cn/img_convert/900de61ce27db366e748b16f81fd2ecd.jpeg" width="656" /></a></p> <br><p></p> <br><h3>问题和解决</h3> <br><p>上面的问题是在执行构建的时候 VitePress 的构建命令不是 npm run build。</p> <br><p>这个构建命令需要改成:<code>npm run docs:build</code></p> <br><p>在 cloudflare page 中选择构建配置。</p> <br><p></p> <br><p></p> <br><p class="img-center"><a href="https://cdn.isharkfly.com/com-isharkfly-www/discourse-uploads/original/3X/a/d/ad108b14d65f61f3c85c8c6d33111f6834f1a4cf.jpeg" rel="nofollow"><img alt="2025-04-11_10-27-32" height="447" src="https://i-blog.csdnimg.cn/img_convert/1f959cc012bbc91303e17f5515b07d45.jpeg" width="690" /></a></p> <br><p></p> <br><p>然后单击编辑按钮, 有 2 个地方要修改。</p> <br><p></p> <br><p></p> <br><p class="img-center"><a href="https://cdn.isharkfly.com/com-isharkfly-www/discourse-uploads/original/3X/8/9/8978f1d6e5eeade46c5f087323cc991bdc95b1ae.jpeg" rel="nofollow"><img alt="2025-04-11_10-28-14" height="499" src="https://i-blog.csdnimg.cn/img_convert/42820de39c6bf20fb54dc65f9f9a5bf9.jpeg" width="447" /></a></p> <br><p></p> <br><p>一个是构建的命令,一个是构建完成后输出文件夹的路径。</p> <br><p>如果dist 文件夹的路径不修改,后面会提示部署找不到需要部署的文件。</p> <br><p></p> <br><p><a class="has-card" href="https://www.isharkfly.com/t/vitepress-cloudflare-page-npm-run-build/17166" rel="nofollow" title="https://www.isharkfly.com/t/vitepress-cloudflare-page-npm-run-build/17166"><span class="link-card-box" contenteditable="false"><span class="link-title">https://www.isharkfly.com/t/vitepress-cloudflare-page-npm-run-build/17166</span><span class="link-link"><img class="link-link-icon" src="https://csdnimg.cn/release/blog_editor_html/release2.3.8/ckeditor/plugins/CsdnLink/icons/icon-default.png?t=P1C7" />https://www.isharkfly.com/t/vitepress-cloudflare-page-npm-run-build/17166</span></span></a></p>
|
Loading…
x
Reference in New Issue
Block a user