GithubHelp home page GithubHelp logo

Comments (21)

zeke avatar zeke commented on August 26, 2024

I'm going to assume you're talking about the diet branch, as master currently doesn't do any caching. In the current implementation, the cache can be busted two ways:

  1. A change in your package.json
  2. A change in the node version that is resolved from your engines.node range, e.g. engines.node is 0.10.x and node stable has changed from 0.10.18 to 0.10.19 since you last deployed.

I'm thinking of changing this to something less magic, and respecting the shrinkwrap file for apps that use it. In this case the cache would be busted by either of the following, in order:

  1. A change in npm-shrinkwrap.json
  2. A change in package.json

Thoughts?

from heroku-buildpack-nodejs.

mojodna avatar mojodna commented on August 26, 2024

Definitely npm-shrinkwrap.json, good call. Not busting the cache when node stable changes would be good too (even if node changes don't have impact, it's an occasion to unexpectedly pick up dependency changes).

Maybe the existence of a .bypass_cache file or something similar (to allow users to opt out entirely). It doesn't handle case-by-case opt outs, but I'm not sure that's possible... (user-env-compile could be added and an environment variable set, but that's a bit weird and has the side-effect of restarting the app before the build occurs.)

What do you think about pre-filling node_modules/ from the cache (if nothing's changed) and then running npm update against it? If it's a shrinkwrapped app, nothing will change, if there wasn't a node_modules/ to begin with (in the repo), the cached version will get updated. If there was a node_modules/ checked in, it might get unexpectedly updated, so maybe check for its existence before pulling from the cache and using that as an indication that npm update shouldn't be run?

from heroku-buildpack-nodejs.

zeke avatar zeke commented on August 26, 2024

I've been pondering the idea of a cache-bypassing file, but it feels a bit hacky. Ideally the cache Just Worksβ„’, and you should never need to bypass it. But yeah, you're probably right.

from heroku-buildpack-nodejs.

svperfecta avatar svperfecta commented on August 26, 2024

I seem to having problems with this today myself. I'm pointing to a specific commit of a Github repo in my package.json file using HTTPS. When I change the commitish, Heroku continues to install the old version; this happens whether I change my project's package.json file or not. I think it should be possible to manually clear the cache, and the cache should be improved to (presumably?) use more than just the version number of the NPM modules since that may stay constant between two different commits.

from heroku-buildpack-nodejs.

danielsantiago avatar danielsantiago commented on August 26, 2024

I'm having the same problem today, and I'm not using module version, I'm using something like this: "module": "git+https://bitbucket.org/company/module.git#master".

I think the problem is related with this: #67

from heroku-buildpack-nodejs.

svperfecta avatar svperfecta commented on August 26, 2024

That's exactly what I was doing.

On Wed, Dec 4, 2013 at 1:28 PM, Daniel Santiago [email protected]:

I'm having the same problem today, and I'm not using module version, I'm
using something like this: "module": "git+
https://bitbucket.org/company/module.git#master".

β€”
Reply to this email directly or view it on GitHubhttps://github.com//issues/48#issuecomment-29831108
.

from heroku-buildpack-nodejs.

danielsantiago avatar danielsantiago commented on August 26, 2024

@genexp I create another issue (#76) because I think the problem we have need to be solve without the "bypassing the cache" feature.

from heroku-buildpack-nodejs.

zeke avatar zeke commented on August 26, 2024

Hey party people, we'll get this worked out eventually but if this is a blocker for you right now then please switch your apps over to the legacy branch for the time being. Instructions here: https://github.com/heroku/heroku-buildpack-nodejs#legacy-compatibility

from heroku-buildpack-nodejs.

jamischarles avatar jamischarles commented on August 26, 2024

+1 for this. We ran into this with the diet buildpack and stopped using it for that reason.

from heroku-buildpack-nodejs.

zeke avatar zeke commented on August 26, 2024

Good news everyone! As of npm v1.3.16, git URL dependencies are now updated on npm install.

from heroku-buildpack-nodejs.

svperfecta avatar svperfecta commented on August 26, 2024

Awesome! Thanks all!

On Thursday, December 19, 2013, Zeke Sikelianos wrote:

Good news everyone! As of npm v1.3.16https://github.com/isaacs/npm/releases/tag/v1.3.16,
git URL dependencies are now updated on npm install.

β€”
Reply to this email directly or view it on GitHubhttps://github.com//issues/48#issuecomment-30907532
.

Brian Corrigan
MadGlory Interactive
http://www.madglory.com
Tw: @madgloryint
Ph: 518.867.1439

from heroku-buildpack-nodejs.

zeke avatar zeke commented on August 26, 2024

This new version of node/npm is now available on Heroku: https://devcenter.heroku.com/changelog-items/374

from heroku-buildpack-nodejs.

joesankey avatar joesankey commented on August 26, 2024

I have hit this issue with node 0.10.24. I had a dependency pointing at the HEAD of a git repo, it was not getting updated. The only workaround I had was to temp remove the dependency and push to Heroku to prune it from the cache...

from heroku-buildpack-nodejs.

danielsantiago avatar danielsantiago commented on August 26, 2024

@joesankey you were using credentials in the git repo URL? For example: https://user:[email protected]/....git? If so there was a problem with this type of URL in the NPM version which come in 0.10.24. It was fixed in the latest version of NPM and node 0.10.25.

from heroku-buildpack-nodejs.

joesankey avatar joesankey commented on August 26, 2024

@danielsantiago nope, I was pointing to https://github.com/brunch/brunch/tarball/master

from heroku-buildpack-nodejs.

danielsantiago avatar danielsantiago commented on August 26, 2024

@joesankey Try this: git+https://github.com/brunch/brunch.git#master

from heroku-buildpack-nodejs.

joesankey avatar joesankey commented on August 26, 2024

@danielsantiago I've already cleared the dependency from the cache so can't try that out. Maybe if someone else hits this they can try.

from heroku-buildpack-nodejs.

zeke avatar zeke commented on August 26, 2024

I think @danielsantiago is on to something with the git+https suggestion: the recent bugfix in npm addresses the updating of git-based dependencies, but apparently pointing directly to http(s) tarballs may be a problem for npm.

from heroku-buildpack-nodejs.

zeke avatar zeke commented on August 26, 2024

After a few months in production, this doesn't appear to be a common issue for customers. There have also been a few developments that mitigate the problems:

I'm closing, but feel free to comment if this still feels like an issue.

from heroku-buildpack-nodejs.

mojodna avatar mojodna commented on August 26, 2024

heroku-repo looks like it'll do the trick. Thanks for the pointer.

from heroku-buildpack-nodejs.

svperfecta avatar svperfecta commented on August 26, 2024

Awesome fix
On Feb 14, 2014 11:14 PM, "Seth Fitzsimmons" [email protected]
wrote:

heroku-repo looks like it'll do the trick. Thanks for the pointer.

Reply to this email directly or view it on GitHubhttps://github.com//issues/48#issuecomment-35146922
.

from heroku-buildpack-nodejs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.