根据环境使用不同的节点模块?

发布于 2025-01-29 13:34:34 字数 252 浏览 2 评论 0原文

我有一个用于多个项目的NPM软件包。当前,当我想更改这些项目上需要更改NPM软件包时,我需要更改NPM软件包,提交PR,等待有人为我合并,然后我可以实际测试我在其他项目上进行的更改(当前没有进行测试)。

我想做的是在其他项目上可以安装 /使用本地模块,而不是全局模块,以便在提交任何PRS之前可以测试全流量。即时通讯使用confip package,理想情况下,我可以将其设置为其,因此,如果我使用特定的配置文件,则默认为本地NPM软件包而不是全局。

这可能吗?

I have a npm package that we use for multiple projects. Currently when I want to make a change to something on these projects that requires a change on the npm package I need to make a change to the npm package, submit a pr, wait for someone to merge it for me and then I can actually test the changes I made on the other projects (no testing is set up currently sadly).

What I want to do is on the other projects have a way to install / use the local module instead of the global one so I can test the full flow before I submit any prs. Im using config package and ideally I can set it up so if I use a specific config file it defaults to local npm package instead of global.

Is this possible?

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

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

发布评论

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

评论(1

天涯离梦残月幽梦 2025-02-05 13:34:34

根据您所描述的内容,请查看软件包管理人员提供的link命令,以帮助解决此问题:

Based on what you are describing, take look at the link command offered by package managers to help solve this:

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