You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to speed up building our app and am confused about caching. From everything I can see, caching is enabled (the ENV VARs are set, the Restoring cache/Caching build steps are working), but running yarn install is still taking 180 seconds? (Done in 179.42s.)
I've tried running multiple builds from the same git commit, as well as new commits with no changes to the yarn.lock file.
-----> Building on the Heroku-20 stack
-----> Using buildpacks:
1. https://github.com/gaffneyc/heroku-buildpack-jemalloc.git
2. heroku/nodejs
3. heroku/jvm
4. heroku/ruby
-----> jemalloc app detected
-----> jemalloc: Vendoring 5.2.1
-----> jemalloc: Building runtime environment
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
YARN_PRODUCTION=true
USE_YARN_CACHE=true
NODE_VERBOSE=false
NODE_ENV=production
NODE_MODULES_CACHE=true
-----> Installing binaries
engines.node (package.json): unspecified
engines.npm (package.json): unspecified (use default)
engines.yarn (package.json): unspecified (use default)
Resolving node version 14.x...
Downloading and installing node 14.16.1...
Using default npm version: 6.14.12
Resolving yarn version 1.22.x...
Downloading and installing yarn (1.22.10)
Installed yarn 1.22.10
-----> Restoring cache
- yarn cache
-----> Installing dependencies
Installing node modules (yarn.lock)
yarn install v1.22.10
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > [email protected]" has unmet peer dependency "webpack@>=1.11.0".
warning " > [email protected]" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".
warning "webpack-dev-server > [email protected]" has unmet peer dependency "webpack@^4.0.0".
[4/4] Building fresh packages...
Done in 179.42s.
-----> Build
-----> Pruning devDependencies
Skipping because YARN_PRODUCTION is 'true'
-----> Caching build
- yarn cache
-----> Build succeeded!
! Unmet dependencies don't fail yarn install but may cause runtime issues
https://github.com/npm/npm/issues/7494
Later on in my pipeline when I get to the ruby buildpack (outside the scope of this repository/team I know), running yarn install again takes only 1.25 seconds.
Is it expected that yarn install should be taking 180 seconds every build, even when caching is used? Or is the caching not working? Not sure how to best debug or diagnose the issue. Any advice?
The text was updated successfully, but these errors were encountered:
I was able to debug more by turning on verbose mode for yarn install.
I added a .yarnrc file to my project with:
--install.verbose true
I was able to use this to see that my project was compiling a native package every time. Upgrading the relevant, project-specific dependency (webpacker in my case) removed the need for that and dropped the yarn install time from 180 seconds to 34 seconds!
After that, the caching got it down to 15 seconds for the yarn install step, so it seems to be working much better.
Leaving this comment in hopes that helps someone else debugging in the future!
I'm trying to speed up building our app and am confused about caching. From everything I can see, caching is enabled (the ENV VARs are set, the Restoring cache/Caching build steps are working), but running
yarn install
is still taking 180 seconds? (Done in 179.42s.
)I've tried running multiple builds from the same git commit, as well as new commits with no changes to the
yarn.lock
file.Later on in my pipeline when I get to the ruby buildpack (outside the scope of this repository/team I know), running
yarn install
again takes only 1.25 seconds.Is it expected that
yarn install
should be taking 180 seconds every build, even when caching is used? Or is the caching not working? Not sure how to best debug or diagnose the issue. Any advice?The text was updated successfully, but these errors were encountered: