❯ deno run -A npm:nuxi init
# just press enter at each prompt
❯ cd nuxt-app
❯ deno task build
❯ deno task preview
ERROR The "nodePath" option must be a string or a file URL: /home/.deno/bin/deno. 2:34:33 PM
at safeNormalizeFileUrl (node_modules/nuxi/dist/chunks/index3.mjs:36:9)
at handleNodeOption (node_modules/nuxi/dist/chunks/index3.mjs:2473:29)
at normalizeOptions (node_modules/nuxi/dist/chunks/index3.mjs:2630:64)
at handleAsyncArguments (node_modules/nuxi/dist/chunks/index3.mjs:7642:63)
at execaCoreAsync (node_modules/nuxi/dist/chunks/index3.mjs:7617:110)
at callBoundExeca (node_modules/nuxi/dist/chunks/index3.mjs:7844:5)
at boundExeca (node_modules/nuxi/dist/chunks/index3.mjs:7815:44)
at Object.run (node_modules/nuxi/dist/chunks/preview.mjs:132:11)
at eventLoopTick (ext:core/01_core.js:175:7)
at async runCommand$1 (node_modules/nuxi/dist/shared/nuxi.b8b195e1.mjs:1648:16)
ERROR The "nodePath" option must be a string or a file URL: /home/.deno/bin/deno
Unfortunately incredibly difficult to fix, because Deno.execPath() requires permissions so we can not eagerly compute the string. And we can't make it a getter because it's an ESM export.
Repro:
I looked into this. The issue is that the named export of
execPath
fromnode:process
is not actually a string, but an object that tries to act like a string: https://github.com/denoland/deno/blob/55c22ee1bd8e5b108b8b13517150c3cfadf4d7f9/ext/node/polyfills/process.ts#L344-L357