Accidentally ended up with a package.json in node_modules.
npm v3.3.0 doesn't take it well:
├── UNMET DEPENDENCY inherits@^2.0.1
└── extraneous error: ENOTDIR: not a directory, open '/Users/timoxley/Projects/tests/npm-packagejson-node_modules/node_modules/package.json/package.json
Problem is the ENOTDIR: not a directory, open.
ENOTDIR: not a directory, open
Works fine in npm v2.
To reproduce, use npm v3 to npm ls in https://github.com/timoxley/npm-packagejson-node_modules
git clone https://github.com/timoxley/npm-packagejson-node_modules
Ok, so what you're reporting is that:
If a non-directory is placed in the node_modules folder then npm ls will report that this is the case in npm@3 where it didn't in npm@2.
Additionally, it does this in rather fraught terms "omg extraneous, augh error!!".
I would propose that we should be reporting this. Eg, if I run npm ls I want to know what's in my node_modules folder... But maybe at a warning level (or just a note) and with a more useful message like "plain file found in node_modules folder".
Backchannel talk w/ @othiym23: He'd like the message suppressed entirely unless the user explicitly asks for it.
Ok, so what we're gonna do is suppress error entries that have ENOTDIR registered as their only error. This will allow random file cruft in your node_modules while still reporting, say, parse errors in your linked deps package.json files.
@iarna sounds good to me 👍
I underestimated how painful writing the tests tests for #9537 would be, combined with the short week, so this has to be pushed out.
Thank you for this, we shipped the fix for this in email@example.com
This issue seems to persist on V 3.3.8 even after re-installing the node version afresh after purging
npm ERR! error in /usr/local/lib/node_modules/npm-debug.log: ENOTDIR, open '/usr/local/lib/node_modules/npm-debug.log/package.json'
npm ERR! invalid: firstname.lastname@example.org /usr/local/lib/node_modules/appium/node_modules/bplist-parser```
@calshankar I've seen this too, so I'm going to reopen this until we figure out whether this is the same issue, or an instance of a new issue.
ok, this only happens with globals, which is why existing tests didn't find it
Any update on this one? I see this also happening e.g entry.node.spec.ts/package.json I'm using 3.10.9