ES6 include references/dependencies in dynamic import

I have FileA that dynamically import FileB from different directory.
The dynamic import fail because FileB importing module ‘lodash’.

The error show

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'lodash'.

FileA.js

// ... My other codes
import("file://D:/plugins/FileB.js");
// ... My other codes

FileB.js

import { now } from "lodash";
console.log(now());

export const Person = {
    name: "John Doe"
}

My question is how to add dependency that needed in dynamic import (here to add lodash in dynamic import)?

Note:

  • The codes is not for browser.
  • The FileA is npm project that have “lodash” installed as dependency. FileB is a single file located outside that project.
  • If I remove codes related to “lodash” in FileB the dynamic import
    work fine.