Skip to content

InvokeFromStringAsync cannot load modules from node_modules #58

@austinw-fineart

Description

@austinw-fineart

https://nodejs.org/api/modules.html#modules_loading_from_node_modules_folders
InvokeFromFileAsync works perfectly fine if you try to load modules like this: require('jsdom'), so long as it follows the rules above. Since there is no script file when using InvokeFromStringAsync, you would think that require starts from NodeJS's working directory, like it does when running the cli. However, setting NodeJSProcessOptions.ProjectPath does not appear to have any effect and module.paths is undefined as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions