admin管理员组文章数量:1031308
VitePress 项目部署 cloudflare page 提示 Node 构建错误
提示的构建错误信息为:
代码语言:javascript代码运行次数:0运行复制09:35:29.838 Error: Exit with error code: 1
09:35:29.839 at ChildProcess.<anonymous> (/snapshot/dist/run-build.js)
09:35:29.839 at Object.onceWrapper (node:events:652:26)
09:35:29.839 at ChildProcess.emit (node:events:537:28)
09:35:29.840 at ChildProcess._handle.onexit (node:internal/child_process:291:12)
09:35:29.847 Failed: build command exited with code: 1
原因和解决
提示上面错误信息的原因是 Yarn 的版本问题。
在默认 NodeJS 的安装情况下,Yarn 会安装 1.22 的版本。
但在cloudflare 构建中,默认会使用 Yarn 3 的版本。
在日志的最上部分,提示了安装 Yarn 的版本信息。
代码语言:javascript代码运行次数:0运行复制09:35:26.187 No wrangler.toml file found. Continuing.
09:35:26.253 Detected the following tools from environment: yarn@3.6.3, nodejs@18.17.1
因此解决办法就是针对 VitePress 项目指定使用 yarn 的版本。
运行命令来进行升级:
yarn set version stable
控制台输出:
代码语言:javascript代码运行次数:0运行复制PS D:\WorkDir\iSharkFly\iSharkFly-Cn\docs-hn> yarn set version stable
➤ YN0000: Downloading .9.1/packages/yarnpkg-cli/bin/yarn.js
➤ YN0000: Saving the new release in .yarn/releases/yarn-4.9.1.cjs
➤ YN0000: Done in 0s 195ms
PS D:\WorkDir\iSharkFly\iSharkFly-Cn\docs-hn> yarn -v
4.9.1
PS D:\WorkDir\iSharkFly\iSharkFly-Cn\docs-hn>
随后推送,重新部署即可。
VitePress 项目部署 cloudflare page 提示 Node 构建错误
提示的构建错误信息为:
代码语言:javascript代码运行次数:0运行复制09:35:29.838 Error: Exit with error code: 1
09:35:29.839 at ChildProcess.<anonymous> (/snapshot/dist/run-build.js)
09:35:29.839 at Object.onceWrapper (node:events:652:26)
09:35:29.839 at ChildProcess.emit (node:events:537:28)
09:35:29.840 at ChildProcess._handle.onexit (node:internal/child_process:291:12)
09:35:29.847 Failed: build command exited with code: 1
原因和解决
提示上面错误信息的原因是 Yarn 的版本问题。
在默认 NodeJS 的安装情况下,Yarn 会安装 1.22 的版本。
但在cloudflare 构建中,默认会使用 Yarn 3 的版本。
在日志的最上部分,提示了安装 Yarn 的版本信息。
代码语言:javascript代码运行次数:0运行复制09:35:26.187 No wrangler.toml file found. Continuing.
09:35:26.253 Detected the following tools from environment: yarn@3.6.3, nodejs@18.17.1
因此解决办法就是针对 VitePress 项目指定使用 yarn 的版本。
运行命令来进行升级:
yarn set version stable
控制台输出:
代码语言:javascript代码运行次数:0运行复制PS D:\WorkDir\iSharkFly\iSharkFly-Cn\docs-hn> yarn set version stable
➤ YN0000: Downloading .9.1/packages/yarnpkg-cli/bin/yarn.js
➤ YN0000: Saving the new release in .yarn/releases/yarn-4.9.1.cjs
➤ YN0000: Done in 0s 195ms
PS D:\WorkDir\iSharkFly\iSharkFly-Cn\docs-hn> yarn -v
4.9.1
PS D:\WorkDir\iSharkFly\iSharkFly-Cn\docs-hn>
随后推送,重新部署即可。
本文标签: VitePress 项目部署 cloudflare page 提示 Node 构建错误
版权声明:本文标题:VitePress 项目部署 cloudflare page 提示 Node 构建错误 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/jiaocheng/1747727782a2209723.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论