If I install a npm package foo
that has a dependency bar
, then I can just use bar
in my code. Is there a good reason to still do a npm install bar
? Eg when the maintainer of foo
decides to replace bar
with something new? Or is that seen as a breaking change in which case I might have to adjust my code anyway?
If to use "bar" you are doing npm i "foo" then it means you are directly depending on "foo" instead of "bar", it simply does not make sense anywhere. There are reasons such as,
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.