Yarn taking 20 minutes do build new Sage installation

I’m trying to install a new Sage Theme and Yarn is taking 20 minutes to build at Yarn command. I’ve tested in two different environments, macOS 13.5 and Windows 11 and the same occur. I’ve changed the Yarn version and Node version with no success.

I’m used to build frontend using Sage on my local desktop and this is the first time that I see Yarn taking too long to build.

Here the build Completed in 25m 35s:

success: installed and set node@20.5.1 (with npm@9.8.0) as default
192:~ viviancruz$ cd /Users/viviancruz/Library/Mobile\ Documents/com\~apple\~CloudDocs/Clientes/Acessebank/Sitio/voz-acesse 
192:voz-acesse viviancruz$ yarn
➤ YN0000: ┌ Resolution step
➤ YN0002: │ @roots/bud-babel@npm:6.7.3 [4c754] doesn't provide webpack (p681a6), requested by babel-loader
➤ YN0002: │ @roots/bud-entrypoints@npm:6.7.3 [f2529] doesn't provide webpack (p0377a), requested by @roots/entrypoints-webpack-plugin
➤ YN0002: │ @roots/bud-postcss@npm:6.7.3 [4c754] doesn't provide webpack (p71895), requested by postcss-loader
➤ YN0002: │ @roots/bud-react@npm:6.7.3 [563c6] doesn't provide webpack (p0ecf6), requested by @pmmmwh/react-refresh-webpack-plugin
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0s 264ms
➤ YN0000: ┌ Link step
➤ YN0007: │ @roots/bud@npm:6.7.3 [ed0cd] must be built because it never has been before or the last one failed
➤ YN0008: │ core-js-pure@npm:3.26.1 must be rebuilt because its dependency tree changed
➤ YN0000: └ Completed in 25m 35s
➤ YN0000: Done with warnings in 25m 36s

node@20.5.1 (with npm@9.8.0) as default
Yarn 3.6.2

Yarn remove and other commands are either too long which makes it impossible to work on my project like this.

I did research about any problem like this on Yarn but only at very old versions of Yarn.

I just opened this topic because I had tested it on 2 different environments and 2 internet connections. Today Im working at my home and everything is back to normal. I couldn’t say for sure if it was an unstable internet connection at the 2 locations. :pray:

2 Likes

I was about to open a new topic on this when I saw this thread. Has the problem been solved for you permanently? The reason I ask is that I haven’t had problems installing dependencies before, but now I get these dreaded 30 minute install sessions with bud you describe above. The trouble is that this occurs while using the internet connection where I work, where the connectivity cannot be improved.

I’m using yarn berry, with the nodeLinker set to node-modules in .yarnrc.yml on a Macbook Pro. When I try to install core-js-pure in an empty folder somewhere else yarn takes 3 seconds to perform the linking, 5 seconds running the entire command.

The process either hangs on core-js-pure or @roots/browserslist-config. I just upgraded bud and the install took 26 minutes:

➤ YN0000: └ Completed in 14s 920ms
➤ YN0000: ┌ Fetch step
➤ YN0019: │ @roots-wordpress-dependencies-webpack-plugin-npm-6.15.1-c42b8225bc-c8c6828193.zip appears to be unused - removing
➤ YN0019: │ @roots-wordpress-externals-webpack-plugin-npm-6.15.1-39474f44f2-4b25860972.zip appears to be unused - removing
➤ YN0019: │ @roots-wordpress-hmr-npm-6.15.1-32fe145cd8-2f74c6e72a.zip appears to be unused - removing
➤ YN0019: │ @roots-wordpress-theme-json-webpack-plugin-npm-6.15.1-3d22625fbb-84926617ad.zip appears to be unused - removing
➤ YN0019: │ @roots-wordpress-transforms-npm-6.15.1-c315161405-f6584e1d7a.zip appears to be unused - removing
➤ YN0000: └ Completed in 4s 945ms
➤ YN0000: ┌ Link step
➤ YN0007: │ @roots/bud-framework@npm:6.15.2 must be built because it never has been before or the last one failed
➤ YN0007: │ @roots/browserslist-config@npm:6.15.2 must be built because it never has been before or the last one failed
➤ YN0008: │ core-js-pure@npm:3.26.1 must be rebuilt because its dependency tree changed
➤ YN0000: └ Completed in 26m 59s
➤ YN0000: Done with warnings in 27m 19s

Is there a way to debug this process or to get more logging info for the install process? My package.json looks as follows:

{
  "name": "sage",
  "private": true,
  "browserslist": [
    "extends @roots/browserslist-config"
  ],
  "engines": {
    "node": ">=16.0.0"
  },
  "type": "module",
  "scripts": {
    "dev": "bud dev",
    "build": "bud build",
    "translate": "yarn translate:pot && yarn translate:update",
    "translate:pot": "wp i18n make-pot . ./resources/lang/sage.pot --include=\"app,resources\"",
    "translate:update": "wp i18n update-po ./resources/lang/sage.pot ./resources/lang/*.po",
    "translate:compile": "yarn translate:mo && yarn translate:js",
    "translate:js": "wp i18n make-json ./resources/lang --pretty-print",
    "translate:mo": "wp i18n make-mo ./resources/lang ./resources/lang"
  },
  "devDependencies": {
    "@roots/bud": "6.15.2",
    "@roots/bud-eslint": "6.15.2",
    "@roots/bud-prettier": "6.15.2",
    "@roots/bud-sass": "6.15.2",
    "@roots/bud-stylelint": "6.15.2",
    "@roots/eslint-config": "6.15.2",
    "@roots/sage": "6.15.2",
    "svg-spritemap-webpack-plugin": "^4.5.0"
  },
  "packageManager": "yarn@3.6.0",
  "dependencies": { }
}

I’ve got the same problemen with a very stable and fast internet connection. It’s stuck on the following install:

➤ YN0000: ┌ Resolution step
➤ YN0032: │ fsevents@npm:2.3.2: Implicit dependencies on node-gyp are discouraged
➤ YN0061: │ stable@npm:0.1.8 is deprecated: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
➤ YN0000: └ Completed in 17s 295ms
➤ YN0000: ┌ Fetch step
➤ YN0013: │ lru-cache@npm:10.0.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ minipass-fetch@npm:3.0.4 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ minipass@npm:7.0.3 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ signal-exit@npm:4.1.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ ssri@npm:10.0.5 can't be found in the cache and will be fetched from the remote registry
➤ YN0000: └ Completed in 0s 465ms
➤ YN0000: ┌ Link step
➤ YN0007: │ @roots/bud-framework@npm:6.12.2 must be built because it never has been before or the last one failed
➤ YN0007: │ @roots/browserslist-config@npm:6.12.2 [1d2a0] must be built because it never has been before or the last one failed
➤ YN0007: │ core-js-pure@npm:3.26.1 must be built because it never has been before or the last one failed

I’m on MacOs 13.3.1

I opened an issue at bud’s tracker a while back related to this problem, but closed it because it seemed a problem with my configuration. Considering I’m not the only one with this problem, I’m thinking of maybe reopening it.

This is probably an issue with the post install command to update the browserslist. It’s triggered in node_modules/@roots/browserslist-config/scripts/postinstall.mjs.

If I execute the command in that script file (npx browserslist --update-db) yarn goes on to update caniuse-lite using (yarn up -R caniuse-lite) which takes forever. Is it the same for you?

Yeah, looks like that’s the problem.

We are experiencing the exact same problem. Is there a workaround?

Also running into this issue, I’m following the steps from others but it gets hung up on `browserslist-config like everyone else and has crashed my M1 Macbook Air multiple times

I also have this problem, on MacOS.

Anyone found a workaround or a fix for this ?

I’m stuck, I tried removing caniuse references manually, updating packages independently, trying update with npm instead of yarn, emptying caches, installing caniuse independently, etc.

Every time install fails or assets don’t build… And no error messages.

I’ve reopened the issue over at the bud issue tracker. Might be good to post any relevant details of your troubles as well over there.

No workaround as of yet. The build eventually resolves in my case but it sometimes takes over 30 to 40 minutes. I’m not on a M1 MacBook by the way, so that doesn’t seem to factor into things.

guess this is the same issue…

➤ YN0000: └ Completed in 0s 449ms
➤ YN0000: ┌ Link step
➤ YN0000: ⠇ --------------------------------------------------------------------
➤ YN0007: │ @roots/bud-framework@npm:6.16.1 must be built because it never has been before or the last one failed
➤ YN0008: │ @roots/bud-framework@npm:6.12.2 must be rebuilt because its dependency tree changed
➤ YN0008: │ @roots/browserslist-config@npm:6.12.2 [1d2a0] must be rebuilt because its dependency tree changed
➤ YN0000: └ Completed in 96m 56s
➤ YN0000: · Done in 96m 57s

Thanks. Eventually it worked for me after 43minutes… I am using an Intel MacBook so yeah, I don’t think the problem is linked with the processor.