Use require() when loading NPM tasks
- Dominant language
- JavaScript
- Stars
- 12.2k
- Forks
- 1.5k
- PR merge metrics
- No merged PRs in 30d
Description
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//package.json` file instead of just requiring it like any other node module?
Contributor guide
Research direction
Start by tracing Grunt's NPM task-loading path and reproduce the P/L/G dependency layout described in the issue. Determine how the loader currently searches for G and verify that the completed change lets L load the shared plugin from P's node_modules tree, with a regression test for this layout.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100