Skip to content

Cannot find module when sub-package depends on the root package #762

@charlespierce

Description

@charlespierce

Due to our file structure not exactly matching what Node expects (i.e. we don't have node_modules and we have an extra version directory), sub packages within an installed binary can't require anything from the main package. This causes problems in @vue/cli, as running the command vue ui results in @vue/cli-ui (a dependency) trying to require('@vue/cli/lib/util/rcPath') (a module in the root package), which fails because Node can't find the root package.

We should come up with a directory structure that adheres to Node's resolution algorithm or otherwise come up with a way of installing tools so that the root package can be accessed from sub-packages.

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