0

I am having an issue with pushing my project live on Heroku, as I am currently using "react-animations", and I have done some customization for a specific animation that's inlcuded in the library. In other words, I have edited a .js file in the node_modules folder. On my development server, it runs perfectly. However, when I push it out, the animation is running as default (not modified). What may cause this?

I have tried to reinitialize the git repo, without any luck. Please help me out!

askaale
  • 1,199
  • 1
  • 23
  • 50

2 Answers2

1

Heroku will install the npm modules as they are published. Any change won't be applied, since it downloads the original modules.

I'm not sure which file you modified or how this module works, but maybe you could try to wrap that specific functionality you created in a function..

Or check this answer: Use modified library in node_modules when deploying to heroku

RanST
  • 404
  • 2
  • 6
  • 20
1

I would suggest you push your

edited a .js file in the node_modules folder

to an accessible location remotely (preferably a version controlling system, I know of Github, GitLab and Bitbucket to support that) for heroku, such that after deployment, heroku can now have access to the library, so that you can create a private npm modules. After which you can now modify your package.json file to this:

"private": true 

Then to reference the private module in another module, also add this to your package.json

{
    "name": "myapp",
    "dependencies": {
        "private-repo": "git+ssh://git@github.com:<githubname>/<githubrepo>.git#v1.0.0",
    }
}

I would suggest you do some more reading on npm-install

antzshrek
  • 9,276
  • 5
  • 26
  • 43