windows通过pnpm dsh web --patch ./scratch-plugin/cordis.yml命令创建插件报错 #4814
|
[cause]: 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 'f:' |
Replies: 1 comment 1 reply
|
支持 Windows。这个错误不是插件代码本身的问题,而是 Node ESM 把原始路径开头的 不要手工处理斜杠和转义,在 PowerShell 中让 Node 生成: $pluginPath = Join-Path $PWD "scratch-plugin\src\my-plugin.ts"
node -e "const {pathToFileURL}=require('node:url'); console.log(pathToFileURL(process.argv[1]).href)" $pluginPath它会输出类似: 把这个完整输出放进 - insert:
- id: hello
name: "file:///F:/path/to/deepseek-harness/scratch-plugin/src/my-plugin.ts"然后重新运行: pnpm dsh web --patch ./scratch-plugin/cordis.yml成功边界是终端打印插件的 当前 完整 Windows 路径说明和 first-plugin 流程: https://github.com/sandbaseai/deepseek-harness-handbook/blob/main/docs/en/plugin-development/first-plugin.md#convert-windows-drive-paths-to-file-urls |
支持 Windows。这个错误不是插件代码本身的问题,而是 Node ESM 把原始路径开头的
F:当成了 URL protocol;ESM loader 需要标准的file:URL。不要手工处理斜杠和转义,在 PowerShell 中让 Node 生成:
它会输出类似:
把这个完整输出放进
scratch-plugin/cordis.yml:然后重新运行:
成功边界是终端打印插件的
[hello-plugin] loaded,而不只是 URL scheme 错误消失。当前
0.1.2-alpha.1源码还会把 overlay 中插入的./src/my-plugin.ts