-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
packages
keys do not appear to be true paths
#645
Comments
They're paths into the ideal tree, I believe, not the actual tree on disk. |
@ljhard I figured. But that's not clear in the documentation. A project I'm on requires information from the package lock file, and I would have been saved a lot of frustration if the documentation had been clearer about that on this point. |
I'd suggest using arborist, rather than directly accessing a lockfile or node_modules. |
@ljhard Thank you for the suggestion. I can consider that. Regardless, this issue is about having clearer npm documentation. |
Documentation for the keys of the
packages
property in package-lock.json files describes them as "relative paths from the root project folder". This does not appear to be entirely true.Consider the following package.json:
package.json:
Assume also that "@scope/package-a" has a dependency on a package called "@scope.package-b". When npm installs dependencies, the project directory structure looks like this:
However, package-lock.json has the following entry under
packages
:Notice the path does not actually exist in the directory.
Documentation should be clear about whether this is expected or whether the relative paths, as described, are true paths.
The text was updated successfully, but these errors were encountered: