cloudflare 构建hexo程序失败

这里写自定义目录标题

cloudflare 构建hexo程序失败

最近在使用hexo搭建博客的时候,准备托管在cloudflare上面,本地部署没问题(本地环境为:macOS 14.4.1,node:20.5.0,npm: 8.6.0 ),push 到GitHub上并在cloudflare上配置Pages并连接git,配置如下:


在这里插入图片描述


多次检查配置都没问题,运行环境也和本地一样

00:22:33.626	Using v2 root directory strategy
00:22:33.650	Success: Finished cloning repository files
00:22:35.475	Checking for configuration in a wrangler.toml configuration file (BETA)
00:22:35.476	
00:22:35.616	No wrangler.toml file found. Continuing.
00:22:35.790	Detected the following tools from environment: nodejs@20.5.0, npm@9.6.7, yarn@3.6.3
00:22:35.791	Installing nodejs 20.5.0
00:22:36.732	Trying to update node-build... ok
00:22:36.941	Downloading node-v20.5.0-linux-x64.tar.gz...
00:22:36.941	-> https://nodejs.org/dist/v20.5.0/node-v20.5.0-linux-x64.tar.gz
00:22:38.560	Installing node-v20.5.0-linux-x64...
00:22:38.958	Installed node-v20.5.0-linux-x64 to /opt/buildhome/.asdf/installs/nodejs/20.5.0
00:22:38.958	
00:22:40.405	Preparing yarn@3.6.3 for immediate activation...
00:22:40.853	Installing project dependencies: yarn

到构建这一步报错了,好家伙

00:22:41.433	➤ YN0070: Migrating from Yarn 1; automatically enabling the compatibility node-modules linker 👍
00:22:41.433	
00:22:41.462	➤ YN0000: ┌ Resolution step
00:22:42.085	➤ YN0061: │ domexception@npm:4.0.0 is deprecated: Use your platform's native DOMException instead
00:22:42.093	➤ YN0061: │ abab@npm:2.0.6 is deprecated: Use your platform's native atob() and btoa() methods instead
00:22:42.213	➤ YN0061: │ cuid@npm:2.1.8 is deprecated: Cuid and other k-sortable and non-cryptographic ids (Ulid, ObjectId, KSUID, all UUIDs) are all insecure. Use @paralleldrive/cuid2 instead.
00:22:42.423	➤ YN0032: │ fsevents@npm:2.3.3: Implicit dependencies on node-gyp are discouraged
00:22:42.838	➤ YN0000: └ Completed in 1s 376ms
00:22:42.858	➤ YN0000: ┌ Post-resolution validation
00:22:42.858	➤ YN0028: │ The lockfile would have been modified by this install, which is explicitly forbidden.
00:22:42.858	➤ YN0000: └ Completed
00:22:42.858	➤ YN0000: Failed with errors in 1s 397ms
00:22:42.890	Error: Exit with error code: 1
00:22:42.890	    at ChildProcess.<anonymous> (/snapshot/dist/run-build.js)
00:22:42.891	    at Object.onceWrapper (node:events:652:26)
00:22:42.891	    at ChildProcess.emit (node:events:537:28)
00:22:42.891	    at ChildProcess._handle.onexit (node:internal/child_process:291:12)
00:22:42.902	Failed: build command exited with code: 1
00:22:43.827	Failed: error occurred while running build command

最后反复试了很多次,找到原因了,问题在这一行

00:22:33.626	Using v2 root directory strategy

只需要把配置生产构建系统的版本从2选到1就可以,默认是选择的2 具体构建系统版本1和2区别请点链接:👉language-support-and-tools


在这里插入图片描述


在部署一次就发现部署成功了


在这里插入图片描述


评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值