Module Not Found Sage 10 w/ Bootstrap

Hi all,
I was following the docs to removed Tailwind and add bootstrap as outlined here:Sage 10.x: CSS Frameworks | Roots Documentation

I found a similar thread here but it’s not the same exact error.

After adjustments to remove tailwind and add bootstrap I ran yarn, and then yarn build and I’m getting a module not found error:

~/Local Sites/cbc2023/app/public/wp-content/themes/CBCtheme$ yarn build
/home/brian/Local Sites/cbc2023/app/public/wp-content/themes/CBCtheme/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
        throw ex;
        ^

Error: Cannot find package '/home/brian/Local Sites/cbc2023/app/public/wp-content/themes/CBCtheme/node_modules/boostrap/' imported from /home/brian/Local Sites/cbc2023/app/public/wp-content/themes/CBCtheme/node_modules/@roots/bud/lib/cli/commands.js
    at new NodeError (file:///home/brian/Local%20Sites/cbc2023/app/public/wp-content/themes/CBCtheme/node_modules/import-meta-resolve/lib/errors.js:276:5)
    at legacyMainResolve (file:///home/brian/Local%20Sites/cbc2023/app/public/wp-content/themes/CBCtheme/node_modules/import-meta-resolve/lib/resolve.js:307:9)
    at packageResolve (file:///home/brian/Local%20Sites/cbc2023/app/public/wp-content/themes/CBCtheme/node_modules/import-meta-resolve/lib/resolve.js:1053:14)
    at moduleResolve (file:///home/brian/Local%20Sites/cbc2023/app/public/wp-content/themes/CBCtheme/node_modules/import-meta-resolve/lib/resolve.js:1117:20)
    at defaultResolve (file:///home/brian/Local%20Sites/cbc2023/app/public/wp-content/themes/CBCtheme/node_modules/import-meta-resolve/lib/resolve.js:1266:15)
    at resolve (file:///home/brian/Local%20Sites/cbc2023/app/public/wp-content/themes/CBCtheme/node_modules/import-meta-resolve/index.js:29:12)
    at file:///home/brian/Local%20Sites/cbc2023/app/public/wp-content/themes/CBCtheme/node_modules/@roots/bud/lib/cli/commands.js:46:24
    at Array.map (<anonymous>)
    at Commands.resolveExtensionCommandPaths (file:///home/brian/Local%20Sites/cbc2023/app/public/wp-content/themes/CBCtheme/node_modules/@roots/bud/lib/cli/commands.js:44:40)
    at Commands.getRegistrationModulePaths (file:///home/brian/Local%20Sites/cbc2023/app/public/wp-content/themes/CBCtheme/node_modules/@roots/bud/lib/cli/commands.js:24:27) {
  code: 'ERR_MODULE_NOT_FOUND'
}

Node.js v18.12.1

I found a similar topic about ensuring bug versions are algined. Here is my package.json

{
  "name": "sage",
  "private": true,
  "browserslist": [
    "extends @roots/browserslist-config/current"
  ],
  "engines": {
    "node": ">=16.0.0"
  },
  "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": "for filename in ./resources/lang/*.po; do msgmerge -U $filename ./resources/lang/sage.pot; done; rm -f ./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": {
    "@popperjs/core": "^2.11.6",
    "@roots/bud": "6.4.5",
    "@roots/bud-sass": "^6.6.2",
    "@roots/sage": "6.4.5",
    "boostrap": "^2.0.0"
  }
}

Not sure what bootstrap is at version 2.0.0 I tried updating that to 5.1.3 and I still get an error.

I also tried to set all my Bud dev dependencies to 6.4.5, but no luck there.

Any ideas?

Looks like you’re trying to import boostrap instead of bootstrap somewhere.

2 Likes

Ah, good eye. Thank you!