-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
Hello,
when trying to run a simple example of creating a sandbox and executing a piece of code inside, I get an error on Windows. For UNIX-based systems, everything works fine:
async with code_sandbox(dependencies=['matplotlib', 'pandas'], allow_networking=False) as sandbox:
return await sandbox.eval("1+1")
The error that I get is:
raise RuntimeError(f'`deno run ...` returned a non-zero exit code {p.returncode}: {"".join(stdout)}')
RuntimeError: `deno run ...` returned a non-zero exit code 1: error: Module not found "file:///C:/WINDOWS/src/main.ts".
By looking at the code, when running deno with a relative path, the base path seems not to be resolved correctly on Windows. Also, I tried setting the correct path manually in the lib, however, then I ran into another error, also related to the relative path of the node_modules (basically there seems to be a problem is in this code:
def _deno_install_args(dependencies: list[str] | None = None) -> list[str]:
args = [
'run',
'--allow-net',
'--allow-read=./node_modules',
'--allow-write=./node_modules',
'--node-modules-dir=auto',
'src/main.ts',
'noop',
]
)
I suppose the easiest way would be to allow the paths to be configurable?
Metadata
Metadata
Assignees
Labels
No labels