nodejitsu/require-analyzer — Issue #45: Dynamic module dependencies not getting picked up on package.json creation
Author: glennblock
Created: 2012-03-04 20:45:14+00:00
State: open

When calling from the command line and the package.json does not exist, dynamic dependencies which exist in node_modules but are not specifically referenced in a require are not picked up. After the package.json is created / it already exists and the cli is ran, they are found.

Repro:

1. Create a new app folder and change to.
2. Create a server.js and put "var express = require('express'). Save and exit.
3. npm install express jade nconf.
4. require-analyzer (assuming it's global)
5. Only express will get picked up
6. require-analyzer
7. jade and nconf will get picked up.

On a diff note, if there are no requires in the server.js, then no dependencies are found.