Skip to content

Strange import behavior when included multiple times #5

Description

@dmoranj

When command-node is used in another library to create a specialized commands module to be imported by a third application, the order of the dependencies in the package.json file for this third application determines whether the console applications will work or fail. If the command-node dependency appears first, the command-line applications will fail when invoking the prompt() function, as the rl internal object will be undefined.

The reason seems to be the instantiation of multiple copies of the command-node library (instead of a single shared one, as expected with a Node.js module). This could be an error or an obscure npm behavior, but either way it can be addressed with a refactor of the library's code. This doesn't seem to be urgent, but may give some headaches in the near future.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions