Skip to content

[Bug] External dependencies from node_modules not being resolved #197

@openbullet

Description

@openbullet

Hello.

First of all, thank you for your amazing work. I'm using version 7.0.0 of this library in my own .NET 8 library, and I've run into an issue. I have a node_modules folder with axios installed inside it. I am running the program from the same folder that contains the node_modules folder, and I'm using StaticNodeJSService.InvokeFromStringAsync<T> to run this script:

module.exports = async () => {
    const axios = require('axios');
    await axios.get('https://example.com');
    console.log("OK");
};

I always get axios is not defined. I even tried to Configure<NodeJSProcessOptions> and set the ProjectPath or the NODE_PATH environment variable, but it didn't help.

I'm using node v20.11.1 and npm 10.2.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions