tuna / mirror-web

Source code of the web interface of https://mirrors.tuna.tsinghua.edu.cn/
GNU General Public License v2.0
759 stars 294 forks source link

编译出现问题 #426

Closed CHEN-Technology closed 4 months ago

CHEN-Technology commented 4 months ago

更新之后尝试重新编译在过程中发现产生错误,更改环境后重新尝试问题依旧,似乎是新添加的文件_vite.config.mjs出现问题,报错如下 [root@localhost mirror-web]# bundle exec jekyll build Configuration file: /root/mirror-web/_config.yml Source: /root/mirror-web Destination: /root/mirror-web/_site Incremental build: disabled. Enable with --incremental Generating... Building with Vite ⚡️ failed to load config from /root/mirror-web/_vite.config.mjs error during build: TypeError: (intermediate value).resolve is not a function at file:///root/mirror-web/_vite.config.mjs.timestamp-1715068357404-37b54626ab73f.mjs:68:46 at Array.map () at Object.readConfigFile (file:///root/mirror-web/_vite.config.mjs.timestamp-1715068357404-37b54626ab73f.mjs:61:51) at readTsConfigFile (file:///root/mirror-web/node_modules/@rollup/plugin-typescript/dist/es/index.js:259:34) at parseTypescriptConfig (file:///root/mirror-web/node_modules/@rollup/plugin-typescript/dist/es/index.js:319:41) at typescript (file:///root/mirror-web/node_modules/@rollup/plugin-typescript/dist/es/index.js:754:27) at file:///root/mirror-web/_vite.config.mjs.timestamp-1715068357404-37b54626ab73f.mjs:130:5 at loadConfigFromFile (file:///root/mirror-web/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:68531:15) at async resolveConfig (file:///root/mirror-web/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:68138:28) at async build (file:///root/mirror-web/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:67273:20)

pid 527570 exit 1 Build with Vite failed! ❌

  Jekyll 4.3.3   Please append `--trace` to the `build` command
                 for any additional information or backtrace.
                ------------------------------------------------

/root/mirror-web/_plugins/jekyll-vite.rb:93:in generate_vite_build': Vite build failed (RuntimeError) from /root/mirror-web/_plugins/jekyll-vite.rb:76:ingenerate' from /usr/share/gems/gems/jekyll-4.3.3/lib/jekyll/site.rb:193:in block in generate' from /usr/share/gems/gems/jekyll-4.3.3/lib/jekyll/site.rb:191:ineach' from /usr/share/gems/gems/jekyll-4.3.3/lib/jekyll/site.rb:191:in generate' from /usr/share/gems/gems/jekyll-4.3.3/lib/jekyll/site.rb:79:inprocess' from /usr/share/gems/gems/jekyll-4.3.3/lib/jekyll/command.rb:28:in process_site' from /usr/share/gems/gems/jekyll-4.3.3/lib/jekyll/commands/build.rb:65:inbuild' from /usr/share/gems/gems/jekyll-4.3.3/lib/jekyll/commands/build.rb:36:in process' from /usr/share/gems/gems/jekyll-4.3.3/lib/jekyll/command.rb:91:inblock in process_with_graceful_fail' from /usr/share/gems/gems/jekyll-4.3.3/lib/jekyll/command.rb:91:in each' from /usr/share/gems/gems/jekyll-4.3.3/lib/jekyll/command.rb:91:inprocess_with_graceful_fail' from /usr/share/gems/gems/jekyll-4.3.3/lib/jekyll/commands/build.rb:18:in block (2 levels) in init_with_program' from /usr/local/share/gems/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:inblock in execute' from /usr/local/share/gems/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in each' from /usr/local/share/gems/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:inexecute' from /usr/local/share/gems/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in go' from /usr/local/share/gems/gems/mercenary-0.4.0/lib/mercenary.rb:21:inprogram' from /usr/share/gems/gems/jekyll-4.3.3/exe/jekyll:15:in <top (required)>' from /usr/local/bin/jekyll:25:inload' from /usr/local/bin/jekyll:25:in <top (required)>' from /usr/local/share/gems/gems/bundler-2.4.21/lib/bundler/cli/exec.rb:58:inload' from /usr/local/share/gems/gems/bundler-2.4.21/lib/bundler/cli/exec.rb:58:in kernel_load' from /usr/local/share/gems/gems/bundler-2.4.21/lib/bundler/cli/exec.rb:23:inrun' from /usr/local/share/gems/gems/bundler-2.4.21/lib/bundler/cli.rb:492:in exec' from /usr/local/share/gems/gems/bundler-2.4.21/lib/bundler/vendor/thor/lib/thor/command.rb:27:inrun' from /usr/local/share/gems/gems/bundler-2.4.21/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in invoke_command' from /usr/local/share/gems/gems/bundler-2.4.21/lib/bundler/vendor/thor/lib/thor.rb:392:indispatch' from /usr/local/share/gems/gems/bundler-2.4.21/lib/bundler/cli.rb:34:in dispatch' from /usr/local/share/gems/gems/bundler-2.4.21/lib/bundler/vendor/thor/lib/thor/base.rb:485:instart' from /usr/local/share/gems/gems/bundler-2.4.21/lib/bundler/cli.rb:28:in start' from /usr/local/share/gems/gems/bundler-2.4.21/exe/bundle:37:inblock in <top (required)>' from /usr/local/share/gems/gems/bundler-2.4.21/lib/bundler/friendly_errors.rb:117:in with_friendly_errors' from /usr/local/share/gems/gems/bundler-2.4.21/exe/bundle:29:in<top (required)>' from /usr/local/bin/bundle:23:in load' from /usr/local/bin/bundle:23:in

'

CHEN-Technology commented 4 months ago

但Docker方式无任何错误 image

Harry-Chen commented 4 months ago

请检查您的 nodejs 版本,至少需要 18.0 以上

CHEN-Technology commented 4 months ago

更新后编译成功,但项目Readme中并未将要求更新,依旧为原本的16 image