本地安装(npm install)时,我可以让 npm 使用我的全局包吗?

发布于 2024-11-25 08:11:25 字数 256 浏览 0 评论 0原文

当我运行 npm install . 时,需要一段时间来构建包含 c 代码(如expresso)的包(这取决于node-jscoverage)。我意识到我可以在运行 npm install 之前将 expresso 从全局包目录 (~/Developer/lib/node_modules/expresso) 复制到当前目录中的 ./node_modules/expresso 。麻烦编译一下。有没有办法告诉 npm 在获取和构建包之前尝试从我的全局 npm 目录安装包?

When I run npm install . it takes a while to build packages that contain c code like expresso (which depends on node-jscoverage). I realized that I can copy expresso from my global package directory (~/Developer/lib/node_modules/expresso) to ./node_modules/expresso in my current directory before running npm install . and it won't bother compiling it. Is there a way to tell npm to try to install packages from my global npm directory before fetching and building them?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

无法言说的痛 2024-12-02 08:11:25

我想这个命令可能会有所帮助: npm 链接

看看这个:npm 从本地位置而不是从网络安装软件包?

I guess this command might help: npm link

Check out this: npm to install packages from local position rather than from web?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文