运行yarn dev启动Discord Bot遇ERR_UNSUPPORTED_ESM_URL_SCHEME错误求助
问题:TypeScript开发Discord机器人启动报错ERR_UNSUPPORTED_ESM_URL_SCHEME
问题情况
- 使用TypeScript开发Discord机器人,执行
yarn dev命令启动项目时触发Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]错误 - 已尝试通过nvm切换Node.js版本(从v21.1.0降至16.20.2),问题未得到解决
- Redis服务运行正常,执行
redis-cli可返回PONG
错误日志
node:events:493 throw er; // Unhandled 'error' event ^ Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:' at throwIfUnsupportedURLScheme (node:internal/modules/esm/load:236:11) at defaultLoad (node:internal/modules/esm/load:128:3) at nextLoad (node:internal/modules/esm/hooks:749:28) at Z (file:///C:/Users/MSI/Documents/GitHub/steadfast-scrim/node_modules/tsx/dist/esm/index.mjs:13:1655) at nextLoad (node:internal/modules/esm/hooks:749:28) at Hooks.load (node:internal/modules/esm/hooks:382:26) at handleMessage (node:internal/modules/esm/worker:199:24) at checkForMessages (node:internal/modules/esm/worker:141:28) at process.<anonymous> (node:internal/modules/esm/worker:160:5) at process.emit (node:events:515:28) { code: 'ERR_UNSUPPORTED_ESM_URL_SCHEME' } Node.js v21.1.0 error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
项目仓库
项目GitHub仓库地址:steadfast-scrim
内容的提问来源于stack exchange,提问作者Hoko L
相关产品推荐
相关产品推荐

