26
u/Fantastic_Sell Apr 10 '20 edited Apr 10 '20
I accidentally forgot a character in a package name and I got some ancient package with hundreds of vulnerabilities according to npm lol
11
24
u/redditindisguise Apr 10 '20
Dependencies and bundlers are somehow both the best and worst things to happen in the industry.
0
Apr 10 '20
[deleted]
9
Apr 10 '20
If those dependencies are maintained and secure, then I'd rather packages depend on them, instead of being incented to write their own implementation.
23
u/realbattousaix Apr 10 '20
Run Npm audit fix, and then, RIP application. lol
0
3
u/martiandreamer Apr 10 '20
What packages are you installing, and what versions? We regularly ‘npm install’ and typically don’t have issues with vulnerable packages.
1
u/fastidious-magician Apr 11 '20
This is actually a 1 year old create-react-app client. ¯_(ツ)_/¯
14
20
u/Cono52 Apr 10 '20
I heard you like vulnerabilities.... SO we put a vulnerability in your vulnerability.
54
Apr 10 '20
npm audit fix —force —yeet
18
8
7
4
4
2
1
0
-24
u/juniorgray07 Apr 10 '20
Use yarn instead, that way solves that kind of problems
3
u/evert Apr 10 '20
What kind of problem would it solve for this case?
-3
Apr 10 '20
I believe one of the things it does it upgrades packages versions of dependency packages, if it is allowed by the ^ indicator. So you only download one version of the package used by many dependent packages. It will certainly warn you of vulnerabilities..
-10
u/juniorgray07 Apr 10 '20
At least until now i do not have to use npm audit or npm fix anymore since i am using yarn
8
u/evert Apr 10 '20
So either Yarn doesn't warn you of security bugs or it automatically upgrades packages without your intervention?
3
2
0
Apr 10 '20
[deleted]
2
u/Earhacker Apr 10 '20
It’s an alternative to the NPM CLI tool, but it uses the same package repository. Yarn’s big USP was that it caches dependencies locally. So if you
yarn add [email protected]in one repo, it’ll download, but when you install it in another repo you’ll get the locally cached version, saving you a download. That makes a huge difference when your project has a lot of dependencies, and also means you can be offline while you work, but I think newer versions of NPM have the same feature.Yarn also includes support for workspaces, which are very useful for monorepos, but my place doesn’t use monorepos so I do t think I can speak to its efficacy.
-12
u/juniorgray07 Apr 10 '20
Honestly is just preferences things because i used to use npm, but later then i started using yarn but you can use npm instead, all the packages have a yarn installation also.
89
u/Pizza_Fox Apr 10 '20
why do you have 880 thousand packages installed