module: report unreadable package.json · nodejs/node@eb5d66e · GitHub
Skip to content

Commit eb5d66e

Browse files
bitpshraduh95
authored andcommitted
module: report unreadable package.json
A package.json that exists but cannot be read was treated the same as one that is not there: the read failure returned no config and resolution continued as if the package had none. Fields such as "exports" and "type" silently disappear, so a specifier can resolve to a different file than the package declares, while an unparsable package.json already throws ERR_INVALID_PACKAGE_CONFIG. Keep treating ENOENT and ENOTDIR as "no package config here", and report any other read failure with the underlying error. Fixes: #65220 Signed-off-by: Paul Bouchon <mail@bitpshr.net> PR-URL: #65223 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent 5c7c0b8 commit eb5d66e

2 files changed

Lines changed: 74 additions & 1 deletion

File tree

src/node_modules.cc

Lines changed: 17 additions & 1 deletion
Lines changed: 57 additions & 0 deletions

0 commit comments

Comments
 (0)