Skip to content

Resolve modules relatively when calling elide run on file in subdirectory #1795

@franklinfollis

Description

@franklinfollis

Summary

elide run path/to/script.ts fails to resolve npm packages when the script is in a subdirectory with its own node_modules.

## Works
$ cd ./my/project/
$ elide run index.ts

# Fails
$ elide run .my/project/index.ts

Fails with:

java.lang.IllegalStateException: Cannot run: Classpaths cannot be calculated without performing `elide install` and `elide build` first. Or, pass `--install` and/or `--build` and Elide will run these for you.

Resolving from where the script is located is already the behavior for Node, Bun, and Deno. elide run should resolve modules relative to where the script is located, not where the command is executed from.

Metadata

Metadata

Labels

module:cliCLI module issues and features

Type

Projects

Status

No status

Relationships

None yet

Development

No branches or pull requests

Issue actions