hexo 提示 Accessing non-existent property 'lineno'

起因: Hexo一直弹如下警告

1
2
3
4
5
6
7
(node:26384) Warning: Accessing non-existent property 'lineno' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:26384) Warning: Accessing non-existent property 'column' of module exports inside circular dependency
(node:26384) Warning: Accessing non-existent property 'filename' of module exports inside circular dependency
(node:26384) Warning: Accessing non-existent property 'lineno' of module exports inside circular dependency
(node:26384) Warning: Accessing non-existent property 'column' of module exports inside circular dependency
(node:26384) Warning: Accessing non-existent property 'filename' of module exports inside circular dependency

解决

  • 见Hexo的Issue #4257,是stylus在报错,可追溯至stylus的Issue #2534,已在stylus @0.54.8 之后版本修复。
  • 利用 npm ls --depth 2 追杀看看哪些依赖还在用老版本的stylus(tmd这是2020年的issue了)
  • 发现这位还留在@0.54.5
  • 算了,直接npm update stylus 把所有stylus都更新一下。
  • 更新之后就不报错了。