npm install:如果存在则使用全局包,而不是安装两次 [英] npm install: Use global package if it exists, rather than installing twice

查看:49
本文介绍了npm install:如果存在则使用全局包,而不是安装两次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

npm installpackage.json 文件一起使用时,如何让它使用符合条件的全局安装包,而不是下载和安装包再本地?

When using npm install with a package.json file, how do I get it to use a globally installed package that meets the criteria instead of downloading and installing the package locally again?

我知道 link,但是有没有办法做我所描述的吗?

I know about link, but is there a way to do what I'm describing?

推荐答案

Yarn 似乎在重复依赖时工作得更好.所以尝试 yarn install 而不是 npm install.

Yarn seems to work much better with repeated dependencies. So try yarn install instead of npm install.

这篇关于npm install:如果存在则使用全局包,而不是安装两次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆