How to clean cache in heroku after installing dependencies?

前提是你 提交于 2019-12-18 03:46:30

问题


Topic : Heroku Problem : After installing my node js application in heroku, I made some changes in package.json. Now, when I am trying to push changes again, new dependencies are not getting installed. Heroku is picking the dependencies from cache.

How to disable cache in heroku ?


回答1:


Thanks all for responding.

After much googling and spending time on my issue, I was able to solve my problem. I thought it would be better to post an answer if anyone faces the similar dilemma.

Below is the documentation, where I found my answer https://devcenter.heroku.com/articles/nodejs-support

  1. By default, in heroku production is set to true. That's why only dependencies get installed. ( & skips devDependencies )

    heroku config:set NPM_CONFIG_PRODUCTION=false
    

Set production to false, to force heroku to install all packages.

** Only do this if doing development.
  1. Heroku, by default, caches all the dependencies, so that the deployment is faster.

    heroku config:set NODE_MODULES_CACHE=false
    
    $ git commit -am 'disable node_modules cache' --allow-empty
    
    $ git push heroku master
    
    ** Preferable only if new dependencies are added in package.json
    


来源:https://stackoverflow.com/questions/45064655/how-to-clean-cache-in-heroku-after-installing-dependencies

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!