Skip to content

更新依赖版本与补全依赖项#350

Closed
emptylight370 wants to merge 1 commit intoikeq:masterfrom
emptylight370:update
Closed

更新依赖版本与补全依赖项#350
emptylight370 wants to merge 1 commit intoikeq:masterfrom
emptylight370:update

Conversation

@emptylight370
Copy link
Copy Markdown
Contributor

  1. 更新 hexo 到 8.1.1
  2. 更新 jasmine 到 5.13.0
  3. 补充 chalk 依赖,在 lib/filter/ssr.js 中使用但未安装

主要目的是解决这个问题:https://github.com/emptylight370/emptylight370.github.io/actions/runs/21429100003/job/61704190165#step:6:16

在本地运行 hexo s 时也会:

> hexo s
INFO  Validating config
ERROR Script load failed: node_modules\hexo-theme-inside\scripts\index.js
Error: Cannot find module 'chalk'
Require stack:
- D:\MyPage\node_modules\hexo-theme-inside\lib\filter\ssr.js
- D:\MyPage\node_modules\hexo-theme-inside\lib\filter\index.js
- D:\MyPage\node_modules\hexo-theme-inside\scripts\index.js

个人进行的修复是直接将 chalk 作为运行依赖安装,在本地测试时正常工作,不知道实际情况如何。

Warning

并且顺带将其他依赖项进行了更新,比如 hexo 更新到 8。但是 Hexo 8 更新对主题有什么影响我是一点不知道,只进行了简单的依赖版本更新,并且在本地测试能正常使用 hexo shexo g,其他情况未知。

1. 更新hexo到8.1.1
2. 更新jasmine到5.13.0
3. 补充chalk依赖,在lib/filter/ssr.js中使用
@emptylight370 emptylight370 marked this pull request as draft February 1, 2026 07:52
@emptylight370
Copy link
Copy Markdown
Contributor Author

> npm run test 

> hexo-theme-inside@2.7.1 test
> jasmine --config=test/jasmine.json

Randomized with seed 96365
Started
...............................F.......FF....................

Failures:
1) hexo-theme-inside utils utils/rest htmlTag()
  Message:
    Expected '' to be '<script>alert(1);</script>'.
  Stack:
        at <Jasmine>
        at UserContext.<anonymous> (***\hexo-theme-inside\test\scripts\utils\rest.js:163:55)
        at <Jasmine>

2) hexo-theme-inside utils utils/rest snippet()
  Message:
    Expected '<script>undefined</script>' to be '<script>alert(1);</script>'.
  Stack:
        at <Jasmine>
        at UserContext.<anonymous> (***\hexo-theme-inside\test\scripts\utils\rest.js:149:8)
        at <Jasmine>
  Message:
    Expected '<foo>undefined</foo>' to be '<foo>alert(1);</foo>'.
  Stack:
        at <Jasmine>
        at UserContext.<anonymous> (***\hexo-theme-inside\test\scripts\utils\rest.js:154:8)
        at <Jasmine>

3) hexo-theme-inside utils utils/rest jsParser()
  Message:
    Expected undefined to be 'var foo=1;'.
  Stack:
        at <Jasmine>
        at UserContext.<anonymous> (***\hexo-theme-inside\test\scripts\utils\rest.js:139:46)
        at <Jasmine>
  Message:
    Expected undefined to be ''.
  Stack:
        at <Jasmine>
        at UserContext.<anonymous> (***\hexo-theme-inside\test\scripts\utils\rest.js:142:30)
        at <Jasmine>

Suite error: hexo-theme-inside Helpers
  Message:
    Error: Cannot find module 'hexo/lib/plugins/helper/url_for'
    Require stack:
    - ***\hexo-theme-inside\test\scripts\helpers\structured_data.js
    - ***\hexo-theme-inside\test\scripts\helpers\index.js
    - ***\hexo-theme-inside\test\index.js
  Stack:
    error properties: Object({ code: 'MODULE_NOT_FOUND', requireStack: [ '***\hexo-theme-inside\test\scripts\helpers\structured_data.js', '***\hexo-theme-inside\test\scripts\helpers\index.js', '***\hexo-theme-inside\test\index.js' ] })
        at Module._resolveFilename (node:internal/modules/cjs/loader:1421:15)
        at defaultResolveImpl (node:internal/modules/cjs/loader:1059:19)
        at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1064:22)
        at Module._load (node:internal/modules/cjs/loader:1227:37)
        at TracingChannel.traceSync (node:diagnostics_channel:328:14)
        at wrapModuleLoad (node:internal/modules/cjs/loader:245:24)
        at Module.require (node:internal/modules/cjs/loader:1504:12)
        at require (node:internal/modules/helpers:152:16)
        at Object.<anonymous> (***\hexo-theme-inside\test\scripts\helpers\structured_data.js:4:16)
        at Module._compile (node:internal/modules/cjs/loader:1761:14)
        at Object..js (node:internal/modules/cjs/loader:1893:10)
        at Module.load (node:internal/modules/cjs/loader:1481:32)
        at Module._load (node:internal/modules/cjs/loader:1300:12)
        at TracingChannel.traceSync (node:diagnostics_channel:328:14)
        at wrapModuleLoad (node:internal/modules/cjs/loader:245:24)
        at Module.require (node:internal/modules/cjs/loader:1504:12)

61 specs, 4 failures
Finished in 0.067 seconds
Randomized with seed 96365 (jasmine --random=true --seed=96365)

@emptylight370 emptylight370 deleted the update branch April 8, 2026 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant