admin管理员组文章数量:1440489
VitePress 项目部署 cloudflare page 提示 npm run build 错误
构建的错误信息如下:
代码语言:javascript代码运行次数:0运行复制09:52:57.975 ➤ YN0000: · Done with warnings in 3s 120ms
09:52:58.072 Executing user command: npm run build
09:52:58.817 npm ERR! Missing script: "build"
09:52:58.818 npm ERR!
09:52:58.818 npm ERR! To see a list of scripts, run:
09:52:58.818 npm ERR! npm run
09:52:58.818
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
09:52:58.825 Failed: Error while executing user command. Exited with error code: 1
问题和解决
上面的问题是在执行构建的时候 VitePress 的构建命令不是 npm run build。
这个构建命令需要改成:npm run docs:build
在 cloudflare page 中选择构建配置。
然后单击编辑按钮, 有 2 个地方要修改。
一个是构建的命令,一个是构建完成后输出文件夹的路径。
如果dist 文件夹的路径不修改,后面会提示部署找不到需要部署的文件。
本文标签: VitePress 项目部署 cloudflare page 提示 npm run build 错误
版权声明:本文标题:VitePress 项目部署 cloudflare page 提示 npm run build 错误 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/biancheng/1747727711a2750412.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论