-
Notifications
You must be signed in to change notification settings - Fork 66
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
Don't publish npm-shrinkwrap.json #91
Comments
I am under the impression that If so, this is our best way to enforce the installation of particular dependencies and avoid all "works on my machine" issues |
@ikkisoft I think it's good to have this file in your repository, but not to publish it with your library. Unlike |
We've been tracing an issue where |
This has started causing a new problem for us as well, since Unfortunately I think we are going to have to back out electronegativity from our testing pipeline until we can run it without pulling all these dependencies. Please consider dropping this file from the published package. 🙏🏼 |
Hello and thanks for reporting this! Electronegativity was designed to be a command-line tool for auditors, which only later was adapted to be optionally used as a library. The documentation on NPM you cited also states:
I'm convinced that the majority of our users are using it as a standalone, global install, but I'm willing to remove the shrinkwrap file for the time being and check with you if you're still experiencing problems (see v1.9.1). I reserve the right to restore it in case of reproducibility issues related to dependency discrepancies. |
Understood! Have you considered separating out the library from the CLI and publishing them as separate artifacts? That might solve the problem of publishing |
I haven't used electronegativity. But isn't this a cli tool ? That means, you could just leave it out your package.json |
Describe the bug
This project publishes its
npm-shrinkwrap.json
. That's discouraged:The practical impact is that electronegativity's dev dependencies are ending up in our package-lock.json (marked as either
optional
orextraneous
, maybe depending on npm version). This is even though we are declaring electronegativity as adevDependency
so its dev dependencies should be ignored. That may be caused by an npm issue. But if electronegativity didn't publish itsnpm-shrinkwrap.json
, that bug wouldn't matter.There are three dev dependencies that are particularly problematic because they or their dependencies have security advisories against them:
To Reproduce
Steps to reproduce the behavior:
npm init
in new directorypackage.json
add:npm install --include=dev
package-lock.json
for"base"
,"chokidar"
,"snapdragon-node"
to see optional or extraneous dependencies.Expected behavior
Expect there to be no
npm-shrinkwrap.json
published withelectronegativity
, so itspackage.json
is used to declare its dependencies. Only the runtime dependencies of electronegativity (and their trees of runtime dependencies) should end up in ourpackage-lock.json
.Platform (please complete the following information):
The text was updated successfully, but these errors were encountered: