Cloudflare failed to build hexo blog

Cloudflare pages
Build command: hexo generate
Build output directory: /public
Root directory: /
Build comments on pull requests: Enabled

Build system version 2

2023-07-15T04:54:15.977102Z	Cloning repository...
2023-07-15T04:54:17.160371Z	From xxxx
2023-07-15T04:54:17.16099Z	 * branch            5a19896fe62c52c41812cb411e902ba3ee520181 -> FETCH_HEAD
2023-07-15T04:54:17.16117Z	
2023-07-15T04:54:18.976032Z	HEAD is now at 5a19896 update
2023-07-15T04:54:18.97679Z	
2023-07-15T04:54:19.098629Z	
2023-07-15T04:54:19.133043Z	Success: Finished cloning repository files
2023-07-15T04:54:19.709803Z	Installing dependencies
2023-07-15T04:54:19.717744Z	Python version set to 2.7
2023-07-15T04:54:22.845645Z	v12.18.0 is already installed.
2023-07-15T04:54:23.944649Z	Now using node v12.18.0 (npm v6.14.4)
2023-07-15T04:54:24.097736Z	Started restoring cached build plugins
2023-07-15T04:54:24.110319Z	Finished restoring cached build plugins
2023-07-15T04:54:24.523289Z	Attempting ruby version 2.7.1, read from environment
2023-07-15T04:54:25.985969Z	Using /opt/buildhome/.rvm/gems/ruby-2.7.1
2023-07-15T04:54:26.941733Z	Using PHP version 5.6
2023-07-15T04:54:27.037608Z	5.2.5 is already installed.
2023-07-15T04:54:27.054366Z	Using Swift version 5.2.5
2023-07-15T04:54:27.05468Z	Started restoring cached node modules
2023-07-15T04:54:27.512071Z	Finished restoring cached node modules
2023-07-15T04:54:27.822159Z	Installing NPM modules using NPM version 6.14.4
2023-07-15T04:54:33.854954Z	
2023-07-15T04:54:33.855459Z	> [email protected] postinstall /opt/buildhome/repo/node_modules/hexo-renderer-marked/node_modules/hexo-util
2023-07-15T04:54:33.855693Z	> npm run build:highlight
2023-07-15T04:54:33.855839Z	
2023-07-15T04:54:34.33642Z	
2023-07-15T04:54:34.33675Z	> [email protected] build:highlight /opt/buildhome/repo/node_modules/hexo-renderer-marked/node_modules/hexo-util
2023-07-15T04:54:34.336903Z	> node scripts/build_highlight_alias.js
2023-07-15T04:54:34.337032Z	
2023-07-15T04:54:34.608653Z	internal/modules/cjs/loader.js:491
2023-07-15T04:54:34.608987Z	  throw new ERR_PACKAGE_PATH_NOT_EXPORTED(basePath, mappingKey);
2023-07-15T04:54:34.609186Z	  ^
2023-07-15T04:54:34.609398Z	
2023-07-15T04:54:34.609719Z	Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/languages/1c' is not defined by "exports" in /opt/buildhome/repo/node_modules/highlight.js/package.json
2023-07-15T04:54:34.609868Z	    at applyExports (internal/modules/cjs/loader.js:491:9)
2023-07-15T04:54:34.609986Z	    at resolveExports (internal/modules/cjs/loader.js:507:23)
2023-07-15T04:54:34.610091Z	    at Function.Module._findPath (internal/modules/cjs/loader.js:635:31)
2023-07-15T04:54:34.610237Z	    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:953:27)
2023-07-15T04:54:34.61035Z	    at Function.Module._load (internal/modules/cjs/loader.js:842:27)
2023-07-15T04:54:34.610454Z	    at Module.require (internal/modules/cjs/loader.js:1026:19)
2023-07-15T04:54:34.610557Z	    at require (internal/modules/cjs/helpers.js:72:18)
2023-07-15T04:54:34.61066Z	    at /opt/buildhome/repo/node_modules/hexo-renderer-marked/node_modules/hexo-util/scripts/build_highlight_alias.js:13:15
2023-07-15T04:54:34.610768Z	    at Array.forEach (<anonymous>)
2023-07-15T04:54:34.610884Z	    at Object.<anonymous> (/opt/buildhome/repo/node_modules/hexo-renderer-marked/node_modules/hexo-util/scripts/build_highlight_alias.js:10:11) {
2023-07-15T04:54:34.611091Z	  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
2023-07-15T04:54:34.611314Z	}
2023-07-15T04:54:34.614083Z	npm ERR! code ELIFECYCLE
2023-07-15T04:54:34.61436Z	npm ERR! errno 1
2023-07-15T04:54:34.615098Z	npm ERR! [email protected] build:highlight: `node scripts/build_highlight_alias.js`
2023-07-15T04:54:34.615354Z	npm ERR! Exit status 1
2023-07-15T04:54:34.615496Z	npm ERR! 
2023-07-15T04:54:34.615618Z	npm ERR! Failed at the [email protected] build:highlight script.
2023-07-15T04:54:34.61576Z	npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2023-07-15T04:54:34.622297Z	npm WARN Local package.json exists, but node_modules missing, did you mean to install?
2023-07-15T04:54:34.622731Z	
2023-07-15T04:54:34.62297Z	npm ERR! A complete log of this run can be found in:
2023-07-15T04:54:34.623155Z	npm ERR!     /opt/buildhome/.npm/_logs/2023-07-15T04_54_34_615Z-debug.log
2023-07-15T04:54:34.770461Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
2023-07-15T04:54:34.770821Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
2023-07-15T04:54:34.77117Z	
2023-07-15T04:54:34.777237Z	npm ERR! code ELIFECYCLE
2023-07-15T04:54:34.77749Z	npm ERR! errno 1
2023-07-15T04:54:34.777663Z	npm ERR! [email protected] postinstall: `npm run build:highlight`
2023-07-15T04:54:34.777815Z	npm ERR! Exit status 1
2023-07-15T04:54:34.777957Z	npm ERR! 
2023-07-15T04:54:34.7781Z	npm ERR! Failed at the [email protected] postinstall script.
2023-07-15T04:54:34.778262Z	npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2023-07-15T04:54:34.79718Z	
2023-07-15T04:54:34.797502Z	npm ERR! A complete log of this run can be found in:
2023-07-15T04:54:34.797669Z	npm ERR!     /opt/buildhome/.npm/_logs/2023-07-15T04_54_34_788Z-debug.log
2023-07-15T04:54:34.809464Z	Error during NPM install
2023-07-15T04:54:34.813193Z	Failed: build command exited with code: 1
2023-07-15T04:54:35.592957Z	Failed: error occurred while running build command

Build system version 1

NODE_VERSION 14.3

2023-07-16T06:36:08.449211Z	Cloning repository...
2023-07-16T06:36:09.279753Z	From xxxxxxx
2023-07-16T06:36:09.280471Z	 * branch            6bee4ba3648ddfc326159862962e2593cc3ebb6b -> FETCH_HEAD
2023-07-16T06:36:09.281301Z	
2023-07-16T06:36:09.328309Z	HEAD is now at 6bee4ba update
2023-07-16T06:36:09.329002Z	
2023-07-16T06:36:09.445115Z	
2023-07-16T06:36:09.476244Z	Success: Finished cloning repository files
2023-07-16T06:36:10.19516Z	Installing dependencies
2023-07-16T06:36:10.203943Z	Python version set to 2.7
2023-07-16T06:36:13.818752Z	Downloading and installing node v14.3.0...
2023-07-16T06:36:14.196812Z	Downloading https://nodejs.org/dist/v14.3.0/node-v14.3.0-linux-x64.tar.xz...
2023-07-16T06:36:27.699969Z	Computing checksum with sha256sum
2023-07-16T06:36:27.818187Z	Checksums matched!
2023-07-16T06:36:32.008265Z	Now using node v14.3.0 (npm v6.14.5)
2023-07-16T06:36:32.340901Z	Started restoring cached build plugins
2023-07-16T06:36:32.350279Z	Finished restoring cached build plugins
2023-07-16T06:36:32.754774Z	Attempting ruby version 2.7.1, read from environment
2023-07-16T06:36:34.318255Z	Using /opt/buildhome/.rvm/gems/ruby-2.7.1
2023-07-16T06:36:35.308856Z	Using PHP version 5.6
2023-07-16T06:36:35.400047Z	5.2.5 is already installed.
2023-07-16T06:36:35.416895Z	Using Swift version 5.2.5
2023-07-16T06:36:35.417391Z	Started restoring cached node modules
2023-07-16T06:36:35.428426Z	Finished restoring cached node modules
2023-07-16T06:36:35.711628Z	Installing NPM modules using NPM version 6.14.5
2023-07-16T06:36:37.288456Z	npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
2023-07-16T06:36:41.753909Z	
2023-07-16T06:36:41.754377Z	> [email protected] postinstall /opt/buildhome/repo/node_modules/hexo-renderer-marked/node_modules/hexo-util
2023-07-16T06:36:41.754547Z	> npm run build:highlight
2023-07-16T06:36:41.754676Z	
2023-07-16T06:36:42.163306Z	
2023-07-16T06:36:42.163639Z	> [email protected] build:highlight /opt/buildhome/repo/node_modules/hexo-renderer-marked/node_modules/hexo-util
2023-07-16T06:36:42.163844Z	> node scripts/build_highlight_alias.js
2023-07-16T06:36:42.164074Z	
2023-07-16T06:36:42.438524Z	internal/modules/cjs/loader.js:497
2023-07-16T06:36:42.438875Z	  throw new ERR_PACKAGE_PATH_NOT_EXPORTED(basePath, mappingKey);
2023-07-16T06:36:42.439072Z	  ^
2023-07-16T06:36:42.439219Z	
2023-07-16T06:36:42.439345Z	Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/languages/1c' is not defined by "exports" in /opt/buildhome/repo/node_modules/highlight.js/package.json
2023-07-16T06:36:42.439479Z	    at applyExports (internal/modules/cjs/loader.js:497:9)
2023-07-16T06:36:42.43959Z	    at resolveExports (internal/modules/cjs/loader.js:513:23)
2023-07-16T06:36:42.439775Z	    at Function.Module._findPath (internal/modules/cjs/loader.js:641:31)
2023-07-16T06:36:42.439959Z	    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1016:27)
2023-07-16T06:36:42.440106Z	    at Function.Module._load (internal/modules/cjs/loader.js:898:27)
2023-07-16T06:36:42.440221Z	    at Module.require (internal/modules/cjs/loader.js:1089:19)
2023-07-16T06:36:42.440339Z	    at require (internal/modules/cjs/helpers.js:73:18)
2023-07-16T06:36:42.440466Z	    at /opt/buildhome/repo/node_modules/hexo-renderer-marked/node_modules/hexo-util/scripts/build_highlight_alias.js:13:15
2023-07-16T06:36:42.440576Z	    at Array.forEach (<anonymous>)
2023-07-16T06:36:42.440681Z	    at Object.<anonymous> (/opt/buildhome/repo/node_modules/hexo-renderer-marked/node_modules/hexo-util/scripts/build_highlight_alias.js:10:11) {
2023-07-16T06:36:42.440816Z	  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
2023-07-16T06:36:42.440935Z	}
2023-07-16T06:36:42.444439Z	npm ERR! code ELIFECYCLE
2023-07-16T06:36:42.444835Z	npm ERR! errno 1
2023-07-16T06:36:42.445624Z	npm ERR! [email protected] build:highlight: `node scripts/build_highlight_alias.js`
2023-07-16T06:36:42.445863Z	npm ERR! Exit status 1
2023-07-16T06:36:42.446014Z	npm ERR! 
2023-07-16T06:36:42.446157Z	npm ERR! Failed at the [email protected] build:highlight script.
2023-07-16T06:36:42.446282Z	npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2023-07-16T06:36:42.453198Z	npm WARN Local package.json exists, but node_modules missing, did you mean to install?
2023-07-16T06:36:42.453645Z	
2023-07-16T06:36:42.453891Z	npm ERR! A complete log of this run can be found in:
2023-07-16T06:36:42.454054Z	npm ERR!     /opt/buildhome/.npm/_logs/2023-07-16T06_36_42_447Z-debug.log
2023-07-16T06:36:42.592289Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
2023-07-16T06:36:42.592654Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
2023-07-16T06:36:42.593037Z	
2023-07-16T06:36:42.600165Z	npm ERR! code ELIFECYCLE
2023-07-16T06:36:42.600412Z	npm ERR! errno 1
2023-07-16T06:36:42.600553Z	npm ERR! [email protected] postinstall: `npm run build:highlight`
2023-07-16T06:36:42.600679Z	npm ERR! Exit status 1
2023-07-16T06:36:42.600831Z	npm ERR! 
2023-07-16T06:36:42.600988Z	npm ERR! Failed at the [email protected] postinstall script.
2023-07-16T06:36:42.60112Z	npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2023-07-16T06:36:42.621017Z	
2023-07-16T06:36:42.621297Z	npm ERR! A complete log of this run can be found in:
2023-07-16T06:36:42.621444Z	npm ERR!     /opt/buildhome/.npm/_logs/2023-07-16T06_36_42_611Z-debug.log
2023-07-16T06:36:42.633967Z	Error during NPM install
2023-07-16T06:36:42.63799Z	Failed: build command exited with code: 1
2023-07-16T06:36:43.387749Z	Failed: error occurred while running build command

我的主要hexo博客最后构建成功在1:41AM July 7, 2023,后面一直构建失败.
这个测试博客只执行了hexo init,没有安装任何插件和修改任何东西.

My main hexo blog was successfully built at 1:41AM July 7, 2023, and has been failing since then
This test blog only executed ‘hexo init’ and did not install any plugins or modify anything.

Solution:

NODE_VERSION 16.18.1