Skip to content

Conversation

@tie
Copy link

@tie tie commented May 1, 2020

This PR fixes originPath being a URL instead of a path.

The requireLike(…).resolve function accepts a path, but CallSite.getFileName(…) returns a URI with file:// scheme. This commit fixes the issue by removing the prefix if origin path starts with file scheme.

Since module path resolution looks for node_modules in all directories of $PWD, the issue does not arise during development. However, scripts started by npx that depend on sandboxed-module package would break with MODULE_NOT_FOUND error.

tie added 5 commits May 1, 2020 14:10
The requireLike(…).resolve function accepts a path, but CallSite.getFileName(…)
returns a URI with file:// scheme. This commit fixes the issue by removing the
prefix if origin path starts with file scheme.

Since module resolution looks for node_modules in all directories of $PWD,
the issue does not arise during development. However, commands that depend on
sandboxed-module package would break with MODULE_NOT_FOUND when using npx.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant