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

Hexo install with pnpm report errors, but yarn not. #5459

Closed mobeicanyue closed 7 months ago

mobeicanyue commented 7 months ago

Check List

Expected behavior

hexo with pnpm working normally

Actual behavior

I use npm previously, and try to migrate to pnpm. I ran

pnpm install 
hexo clean

and encounter the following errors:

╭─    ~/Code/plugin/test                                                                            ✔  21:13:39  ─╮
╰─ pnpm install                                                                                                           ─╯
 WARN  3 deprecated subdependencies found: abab@2.0.6, cuid@2.1.8, domexception@4.0.0
Packages: +343
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 344, reused 343, downloaded 0, added 343, done

dependencies:
+ hexo 7.1.1
+ hexo-abbrlink 2.2.1
+ hexo-generator-archive 2.0.0
+ hexo-generator-category 2.0.0
+ hexo-generator-feed 3.0.0
+ hexo-generator-index 3.0.0
+ hexo-generator-sitemap 3.0.1
+ hexo-generator-tag 2.0.0
+ hexo-renderer-ejs 2.0.0
+ hexo-renderer-marked 6.3.0
+ hexo-renderer-stylus 3.0.1
+ hexo-server 3.0.0
+ hexo-theme-fluid 1.9.7
+ hexo-yam 8.0.0

Done in 16.9s
╭─    ~/Code/plugin/test                                                                    ✔  17s   21:13:59  ─╮
╰─ hexo clean                                                                                                             ─╯
INFO  Validating config
ERROR Script load failed: node_modules/hexo-theme-fluid/scripts/helpers/date.js
Error: Cannot find module 'moment'
Require stack:
- /test/node_modules/hexo-theme-fluid/scripts/helpers/date.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1143:15)
    at Module._load (node:internal/modules/cjs/loader:984:27)
    at Module.require (node:internal/modules/cjs/loader:1231:19)
    at req (/test/node_modules/.pnpm/hexo@7.1.1/node_modules/hexo/dist/hexo/index.js:241:31)
    at /test/node_modules/hexo-theme-fluid/scripts/helpers/date.js:5:16
    at /test/node_modules/.pnpm/hexo@7.1.1/node_modules/hexo/dist/hexo/index.js:249:20
    at tryCatcher (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/promise.js:729:18)
    at _drainQueueStep (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/async.js:102:5)
    at Async.drainQueues (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/async.js:15:14)
    at process.processImmediate (node:internal/timers:478:21)
ERROR Script load failed: node_modules/hexo-theme-fluid/scripts/helpers/utils.js
Error: Cannot find module 'hexo-util'
Require stack:
- /test/node_modules/hexo-theme-fluid/scripts/helpers/utils.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1143:15)
    at Module._load (node:internal/modules/cjs/loader:984:27)
    at Module.require (node:internal/modules/cjs/loader:1231:19)
    at req (/test/node_modules/.pnpm/hexo@7.1.1/node_modules/hexo/dist/hexo/index.js:241:31)
    at /test/node_modules/hexo-theme-fluid/scripts/helpers/utils.js:6:23
    at /test/node_modules/.pnpm/hexo@7.1.1/node_modules/hexo/dist/hexo/index.js:249:20
    at tryCatcher (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/promise.js:729:18)
    at _drainQueueStep (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/async.js:102:5)
    at Async.drainQueues (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/async.js:15:14)
    at process.processImmediate (node:internal/timers:478:21)
ERROR Script load failed: node_modules/hexo-theme-fluid/scripts/helpers/wordcount.js
Error: Cannot find module 'hexo-util'
Require stack:
- /test/node_modules/hexo-theme-fluid/scripts/helpers/wordcount.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1143:15)
    at Module._load (node:internal/modules/cjs/loader:984:27)
    at Module.require (node:internal/modules/cjs/loader:1231:19)
    at req (/test/node_modules/.pnpm/hexo@7.1.1/node_modules/hexo/dist/hexo/index.js:241:31)
    at /test/node_modules/hexo-theme-fluid/scripts/helpers/wordcount.js:5:23
    at /test/node_modules/.pnpm/hexo@7.1.1/node_modules/hexo/dist/hexo/index.js:249:20
    at tryCatcher (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/promise.js:729:18)
    at _drainQueueStep (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/async.js:102:5)
    at Async.drainQueues (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/async.js:15:14)
    at process.processImmediate (node:internal/timers:478:21)
ERROR Script load failed: node_modules/hexo-theme-fluid/scripts/generators/index-generator.js
Error: Cannot find module 'hexo-pagination'
Require stack:
- /test/node_modules/hexo-theme-fluid/scripts/generators/index-generator.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1143:15)
    at Module._load (node:internal/modules/cjs/loader:984:27)
    at Module.require (node:internal/modules/cjs/loader:1231:19)
    at req (/test/node_modules/.pnpm/hexo@7.1.1/node_modules/hexo/dist/hexo/index.js:241:31)
    at /test/node_modules/hexo-theme-fluid/scripts/generators/index-generator.js:3:20
    at /test/node_modules/.pnpm/hexo@7.1.1/node_modules/hexo/dist/hexo/index.js:249:20
    at tryCatcher (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/promise.js:729:18)
    at _drainQueueStep (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/async.js:102:5)
    at Async.drainQueues (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/async.js:15:14)
    at process.processImmediate (node:internal/timers:478:21)
ERROR Script load failed: node_modules/hexo-theme-fluid/scripts/events/lib/footnote.js
Error: Cannot find module 'hexo-util'
Require stack:
- /test/node_modules/hexo-theme-fluid/scripts/events/lib/footnote.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1143:15)
    at Module._load (node:internal/modules/cjs/loader:984:27)
    at Module.require (node:internal/modules/cjs/loader:1231:19)
    at req (/test/node_modules/.pnpm/hexo@7.1.1/node_modules/hexo/dist/hexo/index.js:241:31)
    at /test/node_modules/hexo-theme-fluid/scripts/events/lib/footnote.js:3:23
    at /test/node_modules/.pnpm/hexo@7.1.1/node_modules/hexo/dist/hexo/index.js:249:20
    at tryCatcher (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/promise.js:729:18)
    at _drainQueueStep (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/async.js:102:5)
    at Async.drainQueues (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/async.js:15:14)
    at process.processImmediate (node:internal/timers:478:21)
ERROR Script load failed: node_modules/hexo-theme-fluid/scripts/events/lib/highlight.js
Error: Cannot find module '@adobe/css-tools'
Require stack:
- /test/node_modules/hexo-theme-fluid/scripts/events/lib/highlight.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1143:15)
    at Module._load (node:internal/modules/cjs/loader:984:27)
    at Module.require (node:internal/modules/cjs/loader:1231:19)
    at req (/test/node_modules/.pnpm/hexo@7.1.1/node_modules/hexo/dist/hexo/index.js:241:31)
    at /test/node_modules/hexo-theme-fluid/scripts/events/lib/highlight.js:8:11
    at /test/node_modules/.pnpm/hexo@7.1.1/node_modules/hexo/dist/hexo/index.js:249:20
    at tryCatcher (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/promise.js:729:18)
    at _drainQueueStep (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/async.js:102:5)
    at Async.drainQueues (/test/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/async.js:15:14)
    at process.processImmediate (node:internal/timers:478:21)
INFO  Deleted database.

But moment js is exist in the pnpm lock file image image

How to reproduce?

pnpm install hexo clean

Is the problem still there under Safe mode?

no

Your Node.js & npm version

v20.12.1
10.5.1

Your Hexo and Plugin version

npm ls --depth 0

hexo-site@0.0.0 
├── hexo-abbrlink@2.2.1
├── hexo-generator-archive@2.0.0
├── hexo-generator-category@2.0.0
├── hexo-generator-feed@3.0.0
├── hexo-generator-index@3.0.0
├── hexo-generator-sitemap@3.0.1
├── hexo-generator-tag@2.0.0
├── hexo-renderer-ejs@2.0.0
├── hexo-renderer-marked@6.3.0
├── hexo-renderer-stylus@3.0.1
├── hexo-server@3.0.0
├── hexo-theme-fluid@1.9.7
├── hexo-yam@8.0.0
└── hexo@7.1.1

Your package.json

{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "build": "hexo generate",
    "clean": "hexo clean",
    "deploy": "hexo deploy",
    "server": "hexo server"
  },
  "hexo": {
    "version": "7.1.1"
  },
  "dependencies": {
    "hexo": "^7.1.1",
    "hexo-abbrlink": "^2.2.1",
    "hexo-generator-archive": "^2.0.0",
    "hexo-generator-category": "^2.0.0",
    "hexo-generator-feed": "^3.0.0",
    "hexo-generator-index": "^3.0.0",
    "hexo-generator-sitemap": "^3.0.1",
    "hexo-generator-tag": "^2.0.0",
    "hexo-renderer-ejs": "^2.0.0",
    "hexo-renderer-marked": "^6.3.0",
    "hexo-renderer-stylus": "^3.0.1",
    "hexo-server": "^3.0.0",
    "hexo-theme-fluid": "^1.9.7",
    "hexo-yam": "^8.0.0"
  }
}

Your site's _config.yml (Optional)

No response

Others

No response

mobeicanyue commented 7 months ago

pnpm -v 8.15.2