Comments (21)
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:
- A change in your package.json
- 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:
- A change in npm-shrinkwrap.json
- A change in package.json
Thoughts?
from heroku-buildpack-nodejs.
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.
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.
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.
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.
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.
@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.
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.
+1 for this. We ran into this with the diet buildpack and stopped using it for that reason.
from heroku-buildpack-nodejs.
Good news everyone! As of npm v1.3.16, git URL dependencies are now updated on npm install
.
from heroku-buildpack-nodejs.
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.
This new version of node/npm is now available on Heroku: https://devcenter.heroku.com/changelog-items/374
from heroku-buildpack-nodejs.
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.
@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.
@danielsantiago nope, I was pointing to https://github.com/brunch/brunch/tarball/master
from heroku-buildpack-nodejs.
@joesankey Try this: git+https://github.com/brunch/brunch.git#master
from heroku-buildpack-nodejs.
@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.
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.
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:
- Automatic
npm rebuild
on node version change: https://devcenter.heroku.com/changelog-items/418 - git-based dependencies were semi-recently fixed in npm: https://devcenter.heroku.com/changelog-items/374
- The heroku-repo CLI plugin's
heroku repo:purge_cache
can be used to clear the build cache if absolutely needed.
I'm closing, but feel free to comment if this still feels like an issue.
from heroku-buildpack-nodejs.
heroku-repo
looks like it'll do the trick. Thanks for the pointer.
from heroku-buildpack-nodejs.
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)
- Remove dependency on `semver.herokuapp.com` HOT 2
- Error on Downloading and installing node: gzip: stdin: unexpected end of file HOT 4
- Interview partners for research about communication in GitHub projects wanted
- Do not print out NODE_AUTH_TOKEN HOT 1
- Yarn 2/3 devPruning step fetches all dependencies again. HOT 1
- Yarn version berry's cache folder is increasing slug size
- new yarn versions are missing HOT 2
- npm downgraded to 5.x if default version is 10.x HOT 1
- Prepare release v229 (#1177) breaking changes? HOT 1
- prune-dev-dependencies fails consistently HOT 6
- Using USE_NPM_INSTALL=true does not seem to work when running with pack cli HOT 2
- Build error on a yarn v3.2.2 app using pnp HOT 3
- npm is not using cache HOT 2
- add support for pnpm deploys HOT 2
- The 'yarnPath' could not be read from the 'yarnrc.yml' file HOT 1
- Binary right is not preserved with pnpm HOT 6
- Support ARM64 when using Heroku-24 Docker images
- Yarn 4.4.2 installed with corepack fails to run when package.json contains "type": "module" HOT 4
- Official Bun Support HOT 1
- Split out "functional tests"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from heroku-buildpack-nodejs.