DIYgod / RSSHub

🧡 Everything is RSSible
https://docs.rsshub.app
MIT License
32.52k stars 7.24k forks source link

Error after running pnpm build #15994

Closed CharlesMingus19 closed 3 months ago

CharlesMingus19 commented 3 months ago

Routes

NOROUTE

Full routes

NOROUTE

Related documentation

https://docs.rsshub.app/deploy/

What is expected?

I ran pnpm build after installing dependencies RSSHub should build successfully

What is actually happening?

Getting error: SyntaxError: Invalid or unexpected token

Deployment information

Self-hosted

Deployment information (for self-hosted)

"node":"v21.7.3","pnpm":"9.4.0"

Additional info

root@DietPi:~/RSSHub# pnpm build
 WARN  Unsupported engine: wanted: {"node":">=22"} (current: {"node":"v21.7.3","pnpm":"9.4.0"})

> rsshub@1.0.0 build /root/RSSHub
> tsx scripts/workflow/build-routes.ts

/root/RSSHub/node_modules/.pnpm/googleapis@140.0.0/node_modules/googleapis/build/src/apis/walletobjects/v1.js:13
QU
  ^

SyntaxError: Invalid or unexpected token
    at internalCompileFunction (node:internal/vm:128:18)
    at wrapSafe (node:internal/modules/cjs/loader:1279:20)
    at Module._compile (node:internal/modules/cjs/loader:1331:27)
    at Object.transformer (/root/RSSHub/node_modules/.pnpm/tsx@4.15.7/node_modules/tsx/dist/register-BujtrvNV.cjs:2:1265)
    at Module.load (node:internal/modules/cjs/loader:1205:32)
    at Module._load (node:internal/modules/cjs/loader:1021:12)
    at Module.require (node:internal/modules/cjs/loader:1230:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/root/RSSHub/node_modules/.pnpm/googleapis@140.0.0/node_modules/googleapis/build/src/apis/walletobjects/index.js:18:14)
    at Module._compile (node:internal/modules/cjs/loader:1368:14)
    at Object.transformer (/root/RSSHub/node_modules/.pnpm/tsx@4.15.7/node_modules/tsx/dist/register-BujtrvNV.cjs:2:1265)
    at Module.load (node:internal/modules/cjs/loader:1205:32)
    at Module._load (node:internal/modules/cjs/loader:1021:12)
    at Module.require (node:internal/modules/cjs/loader:1230:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/root/RSSHub/node_modules/.pnpm/googleapis@140.0.0/node_modules/googleapis/build/src/apis/index.js:296:25)
    at Module._compile (node:internal/modules/cjs/loader:1368:14)
    at Object.transformer (/root/RSSHub/node_modules/.pnpm/tsx@4.15.7/node_modules/tsx/dist/register-BujtrvNV.cjs:2:1265)
    at Module.load (node:internal/modules/cjs/loader:1205:32)
    at Module._load (node:internal/modules/cjs/loader:1021:12)
    at Module.require (node:internal/modules/cjs/loader:1230:19)
    at require (node:internal/modules/helpers:179:18) {
  includeSubdirectories: true,
  importMode: 'sync',
  importPattern: /\.ts$/,
  limit: Infinity,
  callerFilePath: '/root/RSSHub/lib/registry.ts',
  callerDirectoryPath: '/root/RSSHub/lib',
  targetDirectoryPath: '/root/RSSHub/lib/routes',
  callback: undefined
}

Node.js v21.7.3
 ELIFECYCLE  Command failed with exit code 1.

This is not a duplicated issue

TonyRL commented 3 months ago

Can't repro.

gitpod /workspace/RSSHub (master) $ pnpm build
 WARN  Unsupported engine: wanted: {"node":">=22"} (current: {"node":"v21.7.3","pnpm":"9.4.0"})

> rsshub@1.0.0 build /workspace/RSSHub
> tsx scripts/workflow/build-routes.ts

(node:10887) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
gitpod /workspace/RSSHub (master) $

Please remove node_modules folder and try again:

rm -rf node_modules
pnpm i
pnpm build