Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
576 views
in Technique[技术] by (71.8m points)

Deploy customized Node.js module on Heroku

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.

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.

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.

How can I use my local update on Heroku?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

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

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...