Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug report] SyntaxError: Unexpected token 'export' #1608

Closed
liuhe32 opened this issue Sep 23, 2024 · 3 comments
Closed

[Bug report] SyntaxError: Unexpected token 'export' #1608

liuhe32 opened this issue Sep 23, 2024 · 3 comments

Comments

@liuhe32
Copy link

liuhe32 commented Sep 23, 2024

Description

image
"type": "module" write in package.json,but cannot run

in "theme-default\lib\node\index.js" what dependent?

Reproduction

https://vuepress.vuejs.org/zh/guide/getting-started.html#%E5%88%9B%E5%BB%BA%E9%A1%B9%E7%9B%AE

Used Package Manager

pnpm

System Info

node_modules\@vuepress\theme-default\lib\node\index.js:4
export * from './defaultTheme.js';
^^^^^^

SyntaxError: Unexpected token 'export'
    at internalCompileFunction (node:internal/vm:77:18)
    at wrapSafe (node:internal/modules/cjs/loader:1287:20)
    at Module._compile (node:internal/modules/cjs/loader:1339:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1434:10)
    at Module.load (node:internal/modules/cjs/loader:1206:32)
    at Module._load (node:internal/modules/cjs/loader:1022:12)
    at cjsLoader (node:internal/modules/esm/translators:358:17)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:307:7)
    at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)

Node.js v21.5.0
Copy link

Hello @liuhe32. Please provide a minimal reproduction using a GitHub repository or vuepress.vuejs.org/new. Issues marked with need reproduction will be closed if they have no activity within 7 days.

@Mister-Hope
Copy link
Member

Mister-Hope commented Sep 23, 2024

node21 is not an official support node version, use lts versions and try again with @next flag

@liuhe32
Copy link
Author

liuhe32 commented Sep 28, 2024

yeah,I have got it and changed v20.17.0(node),it work

@Mister-Hope Mister-Hope closed this as not planned Won't fix, can't repro, duplicate, stale Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants