Yarn Build/Dev Error after removing yarn.lock and node_modules

Hi

Im getting an error “Command failed with exit code 1” after removing node_modules and yarn.lock file in my project.

There is no further Error message on this until im doing yarn build --log. When doing yarn build --log i’m getting this and dont know how to fix this.

`` bud build --log
:arrow_forward: bud Initialized timer…
❯ process.env.NODE_ENV production
❯ process.env.BABEL_ENV production
:arrow_forward: building bud Initialized timer…
… [1/3] bootstrap api
:heavy_check_mark: bound alias
:heavy_check_mark: bound assets
:heavy_check_mark: bound copy
:heavy_check_mark: bound config
:heavy_check_mark: bound webpackConfig
:heavy_check_mark: bound override
:heavy_check_mark: bound define
:heavy_check_mark: bound devtool
:heavy_check_mark: bound entry
:heavy_check_mark: bound js
:heavy_check_mark: bound css
:heavy_check_mark: bound experiments
:heavy_check_mark: bound externals
:heavy_check_mark: bound hash
:heavy_check_mark: bound version
:heavy_check_mark: bound minimize
:heavy_check_mark: bound persist
:heavy_check_mark: bound provide
:heavy_check_mark: bound proxy
:heavy_check_mark: bound run
:heavy_check_mark: bound runtime
:heavy_check_mark: bound serve
:heavy_check_mark: bound splitChunks
:heavy_check_mark: bound extract
:heavy_check_mark: bound template
:heavy_check_mark: bound use
:heavy_check_mark: bound watch
… [2/3] bootstrap project
… [3/3] bootstrap env
:heavy_check_mark: [1/3] bootstrap api
:heavy_check_mark: [3/3] bootstrap env
:heavy_check_mark: [2/3] bootstrap project
… [1/3] register project
… [2/3] register build
… [3/3] register dependencies
:heavy_check_mark: [3/3] register dependencies
:heavy_check_mark: [2/3] register build
:arrow_forward: building profile Initialized timer…
:black_medium_square: building profile Timer run for: 25ms
:heavy_check_mark: [1/3] register project
… [1/2] registered api
… [2/2] registered build
❯ registering action: event.build.before 1 registered
❯ registering action: event.build.after 1 registered
❯ registering action: event.build.after 2 registered
❯ registering action: event.build.before 2 registered
:heavy_check_mark: [2/2] registered build
:heavy_check_mark: [1/2] registered api
… [1/2] boot project
… [2/2] boot cache
:heavy_check_mark: [2/2] boot cache
❯ registering action: event.build.after 3 registered
:heavy_check_mark: [1/2] boot project
… [1/1] booted extensions
:heavy_check_mark: webpack-provide-plugin instantiated
:heavy_check_mark: clean-webpack-plugin instantiated
:heavy_check_mark: copy-webpack-plugin instantiated
:heavy_check_mark: webpack-define-plugin instantiated
:heavy_check_mark: webpack-hot-module-replacement-plugin instantiated
:heavy_check_mark: webpack-manifest-plugin instantiated
:heavy_check_mark: mini-css-extract-plugin instantiated
:arrow_forward: registering Initialized timer…
❯ registering webpack-provide-plugin
❯ registering clean-webpack-plugin
❯ registering copy-webpack-plugin
❯ registering webpack-define-plugin
❯ registering webpack-hot-module-replacement-plugin
❯ registering webpack-manifest-plugin
❯ registering mini-css-extract-plugin
:black_medium_square: registering Timer run for: 1ms
:arrow_forward: booting Initialized timer…
❯ booting webpack-provide-plugin
❯ booting clean-webpack-plugin
❯ booting copy-webpack-plugin
❯ booting webpack-define-plugin
❯ booting webpack-hot-module-replacement-plugin
❯ booting webpack-manifest-plugin
❯ booting mini-css-extract-plugin
:black_medium_square: booting Timer run for: 0ms
❯ importing @roots/bud-postcss
❯ importing @roots/bud-sass
❯ importing @roots/bud-tailwindcss
❯ importing @roots/sage
❯ importing @roots/bud-preset-wordpress
❯ importing @roots/bud-entrypoints
❯ importing @roots/bud-babel
❯ importing @roots/bud-preset-recommend
❯ importing @roots/bud-react
❯ importing @roots/bud-wordpress-externals
❯ importing @roots/bud-wordpress-dependencies
❯ importing @roots/bud-wordpress-manifests
:heavy_multiplication_x: Error: name is a required property for extensions
at new Controller ([secure]/node_modules/@roots/bud-extensions/lib/cjs/Controller/controller.service.js:46:19)
at Extensions.makeController ([secure]/node_modules/@roots/bud-extensions/lib/cjs/Extensions/extensions.service.js:56:28)
at Extensions.setController ([secure]/node_modules/@roots/bud-extensions/lib/cjs/Extensions/extensions.service.js:60:33)
at Extensions.importExtension ([secure]/node_modules/@roots/bud-extensions/lib/cjs/Extensions/extensions.service.js:118:20)
at async [secure]/node_modules/@roots/bud-extensions/lib/cjs/Extensions/extensions.service.js:95:17
at async Promise.all (index 0)
at async Extensions.injectExtensions ([secure]/node_modules/@roots/bud-extensions/lib/cjs/Extensions/extensions.service.js:94:13)
at async Extensions.booted ([secure]/node_modules/@roots/bud-extensions/lib/cjs/Extensions/extensions.service.js:77:9)
at async [secure]/node_modules/@roots/bud-framework/lib/cjs/Framework/lifecycle/index.js:57:13
at async Promise.all (index 0)
error Command failed with exit code 1.
info Visit yarn run | Yarn for documentation about this command.`
type or paste code here


does anyone else having the same issue?

:thinking: From the error message it appears that bud tries to use a bud extension (at least it assumes a module to be one) that does not have required fields (the name field in this case).
Are the versions of the bud and bud extension npm dependencies in package.json matching (or up to date)?

1 Like

we are using

  "devDependencies": {
    "@roots/bud": "5.6.2",
    "@roots/bud-postcss": "^5.6.2",
    "@roots/bud-sass": "^5.6.2",
    "@roots/bud-tailwindcss": "5.6.2",
    "@roots/sage": "5.6.2",
    "prettier": "^2.8.1",
    "prettier-plugin-tailwindcss": "^0.2.1"
  },

The versions may look the same at a first glance, but 5.6.2 (for @roots/bud) and ^5.6.2 (for the other @roots/ dependencies) may resolve differently.
Make all either ^5.6.2 or 5.6.2, re-install and re-build. That alone may already fix this issue.

Caret (^)
major version is fixed, matches any minor version, matches any build number

(See this about ^ (caret) version prefix: node.js - What's the difference between tilde(~) and caret(^) in package.json? - Stack Overflow)

First of all, thx for you help.

now when i remove all ^ the build works but when running yarn dev this error occurs:

when i add an ^ to all versions everything runs like expected but assets like fonts and images are not loaded.

i really dont know why this isnt working anymore, 2 weeks ago it worked properly, now all of my projects in with this setup doesnt work anymore.

What is the exact version of that Sage 10 theme?

The current version of @roots/bud is 6.12.3, the other @roots/bud packages also have newer versions (usually the same as the main @roots/bud package).

Cant say the exact version cause in my style.css file the Version is 10.x-dev.
Is there an other place to find the exact version? I think its one of the first sage 10 releases like 10.1 or so