在Heroku上部署自定义的Node.js模块 [英] Deploy customized Node.js module on Heroku

查看:73
本文介绍了在Heroku上部署自定义的Node.js模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经通过运行 npm install 命令安装了 drupal-node.js 模块。然后我进入 node_modules 文件夹中的 drupal-node.js 并在其中放置另一个模块。

I have installed the drupal-node.js module by running npm install command. And then I go inside drupal-node.js in node_modules folder and done place another module inside it.

要运行上面的Node.js应用,我必须进入 node_modules 文件夹,并放入 drupal -node.js ,然后运行 node app.js

To run my above Node.js app, I have to go inside node_modules folder and in drupal-node.js and I run node app.js.

现在,我必须将我上面的Node.js应用程序部署到Heroku。但是我认为Heroku不允许我们在 node_modules / 文件夹中进行更改。

Now, I have to deploy my above Node.js app to Heroku. But I think Heroku doesn't allow us to make changes in the node_modules/ folder.

如何使用我在Heroku上的本地更新?

How can I use my local update on Heroku?

推荐答案

我无法想到一种情况,您应该直接修改 node_modules / 。如果确实需要修改库,请将更改提交给库维护者。

I can't think of a single situation where you should be directly modifying anything in node_modules/. If you really need to modify a library, submit your change to the library maintainers.

如果由于某种原因这不是一个选择,请派生该库并使用纱线 npm

If that's not an option for whatever reason, fork the library and install from your fork using yarn or npm.

分叉图书馆不应该'不要轻易做。这样做会给您的项目增加维护负担。现在,除了您自己的代码外,您还需要维护自己的fork。从上游获取更新,以便您可以利用错误修复和安全更新,这一点很重要。

Forking a library shouldn't be done lightly. By doing this you're adding a maintenance burden to your project. Now, in addition to your own code, you need to maintain your fork. Pulling updates in from upstream so you can take advantage of bug fixes and security updates is important.

这篇关于在Heroku上部署自定义的Node.js模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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