hexojs / hexo

A fast, simple & powerful blog framework, powered by Node.js.
https://hexo.io
MIT License
39.59k stars 4.86k forks source link

fail to build hexo #5408

Closed uiolee closed 10 months ago

uiolee commented 10 months ago

Check List

Expected behavior

Build successfully

Actual behavior

https://github.com/hexojs/hexo/actions/runs/7666372926/job/20894038821?pr=5407

fail

> hexo@7.1.1 build D:\hexo
> tsc -b

node_modules/.pnpm/chokidar@3.5.3/node_modules/chokidar/types/index.d.ts:9:14 - error TS2420: Class 'import("D:/hexo/node_modules/.pnpm/chokidar@3.5.3/node_modules/chokidar/types/index").FSWatcher' incorrectly implements interface 'import("fs").FSWatcher'.
  Type 'FSWatcher' is missing the following properties from type 'FSWatcher': ref, unref

9 export class FSWatcher extends EventEmitter implements fs.FSWatcher {
               ~~~~~~~~~

Found 1 error.

 ELIFECYCLE  Command failed with exit code 1.

How to reproduce?

  1. git clone
  2. npm i
  3. npm run build

Is the problem still there under Safe mode?

..

Your Node.js & npm version

No response

Your Hexo and Plugin version

No response

Your package.json

No response

Your site's _config.yml (Optional)

No response

Others

uiolee commented 10 months ago
-    "@types/node": "^18.11.8",
+    "@types/node": "^18.11.8 <18.19.9",

typescript build will failed in @types/node@18.19.9 and newer.

this issue existed in hexo-fs too

panxsz commented 10 months ago

管理员_ Windows PowerShell 2024_1_27 14_07_10

uiolee commented 10 months ago

https://github.com/paulmillr/chokidar/issues/1299