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


在这里插入图片描述


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


在这里插入图片描述


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
根据提供的引用内容,以下是关于Java使用Cloudflare的介绍和示例: Cloudflare是一个提供CDN(内容分发网络)和安全性服务的公司。它的API允许开发人员通过编程方式与Cloudflare进行交互,以管理其网站的各种设置和功能。 在Java中使用Cloudflare API,可以使用CloudflareApiLibrary来简化和加快开发过程。该库提供了一些方便的方法和功能,使得与Cloudflare API的交互更加容易。 以下是一个使用CloudflareApiLibrary的示例,用于获取网站的DNS记录: ```java import com.cloudflare.api.CloudflareAccess; import com.cloudflare.api.constants.CloudflareValue; import com.cloudflare.api.requests.dns.DNSRecordCreateRequest; import com.cloudflare.api.requests.dns.DNSRecordGetRequest; import com.cloudflare.api.requests.dns.DNSRecordUpdateRequest;import com.cloudflare.api.results.CloudflareError; import com.cloudflare.api.results.CloudflareResponse; import com.cloudflare.api.results.DNSRecord; import com.cloudflare.api.results.Result; public class CloudflareExample { public static void main(String[] args) { // 设置Cloudflare API的访问密钥和邮箱 CloudflareAccess.getInstance().setAuthKey("YOUR_API_KEY"); CloudflareAccess.getInstance().setAuthEmail("YOUR_EMAIL"); // 获取网站的DNS记录 DNSRecordGetRequest getRequest = new DNSRecordGetRequest("YOUR_DOMAIN"); CloudflareResponse<Result<DNSRecord>> getResponse = getRequest.execute(); if (getResponse.isSuccess()) { Result<DNSRecord> result = getResponse.getResult(); for (DNSRecord record : result.getResult()) { System.out.println(record.getName() + " - " + record.getContent()); } } else { CloudflareError error = getResponse.getError(); System.out.println("Error: " + error.getMessage()); } } } ``` 这个示例演示了如何使用CloudflareApiLibrary来获取网站的DNS记录。首先,需要设置Cloudflare API的访问密钥和邮箱。然后,创建一个DNSRecordGetRequest对象,并指定要获取DNS记录的域名。最后,执行请求并处理响应,打印出每个DNS记录的名称和内容。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值