npm命令

1、npm dedupe / npm ddp

重新整理本地包的依赖关系,使一些公共依赖走向依赖树的更高层级,方便更多包共同使用,减少依赖的重复引入。

Searches the local package tree and attempts to simplify the overall structure by moving dependencies further up the tree, where they can be more effectively shared by multiple dependent packages.

依赖的查找顺序,先在本级查找,然后依次往上级查找。

2、npm config

npm全局配置,可以设置全局依赖的安装路径

https://www.npmjs.com.cn/cli/dedupe/

猜你喜欢

转载自www.cnblogs.com/shengulong/p/9463789.html