Skip to content

Use require() when loading NPM tasks #1211

Description

@rbelouin

I wrote a library using grunt to build itself. Let's call it L.
I wrote a project using grunt to build itself, and using L as a dependency. Let's call it P.
Both L and P are using the same grunt plugin. Let's call it G.

Because npm does install a library just once in a node_modules tree, here is the hierarchy of the P project after running npm install:

./P
./P/node_modules
./P/node_modules/G
./P/node_modules/L

But there is no ./P/node_modules/L/node_modules/G and that makes grunt fail to build L.

Why is grunt searching for a ./node_modules/<plugin>/package.json file instead of just requiring it like any other node module?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions