Skip to content

[Bug] SyntaxError: Unexpected token 'with' #121

@huhan-123

Description

@huhan-123

💻 系统环境 | Operating System

macOS

🌐 CLI 版本 | CLI Version

pnpm install -g @lobehub/i18n-cli 命令下载的,应该是最新版本?

🐛 问题描述 | Bug Description

import cliBoxes from './boxes.json' with {type: 'json'};
^^^^
SyntaxError: Unexpected token 'with'
at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:118:18)
at callTranslator (node:internal/modules/esm/loader:273:14)
at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:278:30)

Node.js v20.8.1

🚦 期望结果 | Expected Behavior

不报错

📷 复现步骤 | Recurrence Steps

执行任意命令报错

📝 补充信息 | Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    InactiveNo response in 30 days | 超过 30 天未活跃🐛 BugSomething isn't working | 缺陷

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions