This guide helps you solve common problems you might encounter while working with this Bootstrap theme.
What it means: Node.js and NPM are not installed.
How to fix:
Go to https://nodejs.org/
Download the LTS version (Long Term Support - the more stable option)
Run the installer
Follow the installation wizard (keep all default options)
Restart your terminal/command prompt (this is important!)
Verify installation:
node --version
Should show something like v20.10.0
npm --version
Should show something like 10.2.3
Still not working?
sudo npm install for permissionsOn Windows:
Run Command Prompt as Administrator:
npm installOn Mac/Linux:
sudo npm install
Enter your password when prompted.
Better solution (avoid sudo):
Configure npm to use a different directory:
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
export PATH=~/.npm-global/bin:$PATH
Add the last line to your ~/.bashrc or ~/.zshrc file.
What it means: You're not in the right directory.
How to fix:
Make sure you're in the project folder:
pwd # Mac/Linux - shows current directory
cd # Windows - shows current directory
Navigate to the project:
cd /path/to/your/theme/folder
List files to verify:
ls # Mac/Linux
dir # Windows
You should see package.json in the list.
If you see orange "DEPRECATION WARNING" messages:
These have been suppressed in the latest version. Your build should run cleanly without warnings.
What they were: Warnings from Sass about future changes (years away, not urgent)
Why they appeared: Bootstrap 5.3.x uses older Sass syntax that will be updated in future versions
Are they harmful? No! Everything works perfectly. They're just reminders about code that will be updated eventually.
Want to know more? Read the detailed explanation: ABOUT_DEPRECATION_WARNINGS.md
If you still see warnings: Make sure you have the latest package.json. Run:
npm run build
The build should complete with just:
> enterprise-bootstrap-theme@1.0.0 build
> npm run build:css && npm run copy:js
...
(no warnings shown)
Checklist:
1. Did you save your file?
2. Did you run the build?
npm run build
3. Did you refresh the browser?
4. Did you edit the right file?
src/scss/_variables.scss or src/scss/custom.scsscss/custom.css (this gets overwritten!)5. Is your browser caching the CSS?
Disable cache in browser DevTools:
6. Are you looking at the right file?
Make sure your HTML file links to the compiled CSS:
<!-- Correct -->
<link rel="stylesheet" href="../css/custom.css">
<!-- Wrong - this doesn't exist -->
<link rel="stylesheet" href="../src/scss/custom.scss">
Full error:
Error: File to import not found or unreadable: variables
What it means: Sass can't find the file you're trying to import.
Common causes:
1. Typo in filename:
❌ @import 'variabls'; // Typo!
✅ @import 'variables'; // Correct
2. Wrong path:
❌ @import 'variables'; // Looking in same folder
✅ @import '../variables'; // If variables is in parent folder
3. Missing underscore:
In Sass, files starting with _ are "partials". When importing:
// File is named: _variables.scss
❌ @import '_variables'; // Don't include the underscore
✅ @import 'variables'; // Correct
How to fix:
ls src/scss/ (Mac/Linux) or dir src\scss (Windows)Full error:
Error: Undefined variable: "$primary-color"
What it means: You're using a variable that hasn't been defined.
Common causes:
1. Typo in variable name:
// Defined as:
$primary: #1c7ed6;
// Used as:
color: $primery; // ❌ Typo!
color: $primary; // ✅ Correct
2. Variable not defined yet:
❌
.button {
color: $my-color; // Used before definition
}
$my-color: #ff0000; // Defined after use
✅
$my-color: #ff0000; // Define first
.button {
color: $my-color; // Use second
}
3. Variable in wrong file:
If you define a variable in custom.scss, you can't use it in _variables.scss because _variables.scss is imported first.
File import order:
// In custom.scss:
@import 'variables'; // 1. Variables loaded first
@import 'node_modules/bootstrap/scss/bootstrap'; // 2. Bootstrap second
// 3. Your custom styles here (can use variables)
Full error:
Error: Expected { after selector
What it means: Syntax error in your SCSS.
Common causes:
1. Missing opening bracket:
❌
.button
color: red;
}
✅
.button {
color: red;
}
2. Missing semicolon on previous line:
❌
.button {
color: red // Missing semicolon!
padding: 10px;
}
✅
.button {
color: red; // Added semicolon
padding: 10px;
}
3. Using CSS in a media query incorrectly:
❌
@media (min-width: 768px) // Missing opening bracket
.button {
padding: 20px;
}
}
✅
@media (min-width: 768px) {
.button {
padding: 20px;
}
}
Causes and solutions:
1. Building too often:
Instead of running npm run build after every change:
npm run watch
This watches your files and rebuilds automatically when you save.
2. Large project:
If you have many SCSS files, builds take longer. This is normal.
3. Antivirus scanning:
Some antivirus software scans every file created, slowing builds. Add your project folder to the antivirus exclusions.
Try these solutions:
1. Restart watch mode:
# Stop watch mode: Ctrl+C
# Start it again:
npm run watch
2. Save the file: Make sure you actually saved the file (check for unsaved indicator in your editor).
3. Check file path:
Watch mode only watches src/scss/ folder. Make sure your file is there.
4. Editor-specific issues:
Some editors (like VS Code) have settings that affect file watching:
Possible causes:
1. Browser color profiles:
Different monitors and browsers can display colors slightly differently. This is normal.
2. Opacity/transparency:
// Solid color
background-color: $primary; // Solid blue
// Transparent color
background-color: rgba($primary, 0.5); // 50% transparent blue
3. Color mixing:
// Pure color
background-color: $primary;
// Mixed color (lighter)
background-color: mix($primary, white, 70%);
4. Browser DevTools:
Check the actual color in DevTools:
Debugging steps:
1. Check the selector:
// Make sure your selector matches your HTML
// SCSS:
.my-button {
color: red;
}
// HTML must have exactly this class:
<button class="my-button">Click Me</button>
2. Check specificity:
More specific selectors override less specific ones:
// Less specific (color: blue)
.button {
color: blue;
}
// More specific (color: red wins)
.container .button {
color: red;
}
3. Check the cascade:
Styles defined later override earlier ones:
.button {
color: blue; // Defined first
}
.button {
color: red; // Defined later - this wins
}
4. Use !important (last resort):
.button {
color: red !important; // Forces this to apply
}
Warning: Avoid !important if possible. It makes styles harder to maintain.
5. Use browser DevTools:
Solution: Use the spacing system consistently.
Bad approach:
.component1 {
margin: 13px;
}
.component2 {
margin: 15px;
}
.component3 {
margin: 12px;
}
Good approach:
.component1 {
margin: $spacer;
}
.component2 {
margin: $spacer * 1.25;
}
.component3 {
margin: $spacer;
}
Or use Bootstrap classes:
<div class="m-3">Consistent spacing</div>
<div class="m-4">Also consistent</div>
Common causes:
1. Border color same as background:
❌
.box {
background-color: white;
border: 1px solid white; // Same color - invisible!
}
✅
.box {
background-color: white;
border: 1px solid $gray-300; // Visible contrast
}
2. Missing border style:
❌
.box {
border-color: red;
border-width: 2px;
// Missing border-style!
}
✅
.box {
border: 2px solid red; // All three: width, style, color
}
3. Border collapsed:
On tables:
<table style="border-collapse: collapse;">
<!-- Borders might not show as expected -->
</table>
What it is: Browser inconsistencies.
Solution: This theme includes Autoprefixer, which handles most issues automatically.
If problems persist:
1. Check browser version:
Update to the latest version of:
2. Check for browser-specific CSS:
Some CSS properties need vendor prefixes:
// Don't write prefixes manually - Autoprefixer does this!
.box {
display: flex; // Autoprefixer adds -webkit-flex, etc.
}
3. Test in multiple browsers:
Use:
Common causes:
1. Missing viewport meta tag:
Make sure your HTML has this in the <head>:
<meta name="viewport" content="width=device-width, initial-scale=1.0">
2. Fixed widths:
❌
.container {
width: 1200px; // Too wide for mobile!
}
✅
.container {
width: 100%;
max-width: 1200px;
}
3. Not using Bootstrap grid:
✅ Responsive
<div class="row">
<div class="col-md-6">Left</div>
<div class="col-md-6">Right</div>
</div>
❌ Not responsive
<div style="width: 50%; float: left;">Left</div>
<div style="width: 50%; float: left;">Right</div>
4. Test on actual mobile devices:
Emulation isn't perfect. Test on real phones/tablets when possible.
Possible causes:
1. Font not loaded:
If using Google Fonts, make sure the <link> is in your HTML <head>:
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap" rel="stylesheet">
2. Font family typo:
❌
$font-family-sans-serif: 'Interr', sans-serif; // Typo!
✅
$font-family-sans-serif: 'Inter', sans-serif;
3. Font not installed (for system fonts):
// This font only works on Windows:
$font-family-sans-serif: 'Segoe UI', sans-serif;
// Better - fallbacks for all systems:
$font-family-sans-serif: 'Segoe UI', -apple-system, Arial, sans-serif;
4. Browser using fallback font:
Check in DevTools:
Error format:
Error: [error message]
╷
5 │ @import 'variables';
│ ^^^^^^^^^^^
╵
src/scss/custom.scss 5:9 root stylesheet
How to read it:
Common errors:
1. "Expected expression"
❌
.button {
color: ; // No value!
}
✅
.button {
color: red;
}
2. "Invalid CSS after"
❌
.button {
color: red blue; // Can't have two colors!
}
✅
.button {
color: red;
}
3. "Expected }"
❌
.button {
color: red;
// Missing closing bracket!
✅
.button {
color: red;
} // Added closing bracket
"Cannot find module"
Meaning: A package isn't installed.
Fix:
npm install
"EACCES: permission denied"
Meaning: You don't have permission to write to the folder.
Fix:
sudo npm install or fix npm permissions"gyp ERR! stack Error: spawn ENOENT"
Meaning: Build tools missing (usually on Windows).
Fix:
npm install --global windows-build-tools
When something breaks:
If something complex doesn't work:
Example:
// Not working - too complex to debug:
.button {
background: linear-gradient(45deg, $primary, darken($primary, 20%));
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
transform: translateY(-2px);
}
// Start simple:
.button {
background-color: $primary;
}
// Works? Add one feature:
.button {
background-color: $primary;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
// Still works? Add another:
// ... and so on
In SCSS, you can output debug information:
// Check variable value
@debug "Primary color is: #{$primary}";
// Check calculation result
@debug "Spacer times 2 is: #{$spacer * 2}";
This shows in your terminal when you build.
Find which part is causing problems:
.button {
color: red;
// padding: $spacer; // Commented out
// border: 1px solid $primary; // Commented out
// border-radius: $border-radius; // Commented out
}
Uncomment one line at a time to find the culprit.
Look at the demo files:
demo/index.html - Working HTMLsrc/scss/custom.scss - Working custom stylessrc/scss/_variables.scss - Working variablesCopy how they do things.
Copy the error message and search:
Chances are someone else has had the same problem!
If things are really broken:
1. Delete generated files:
rm -rf dist/ # Mac/Linux
rmdir /s dist # Windows
# Rebuild:
npm run build
2. Reinstall packages:
rm -rf node_modules # Mac/Linux
rmdir /s node_modules # Windows
npm install
npm run build
3. Start from a clean state:
If you have Git:
git status # See what changed
git diff # See exact changes
git checkout -- . # Undo all changes (careful!)
What you're trying to do: "I want to change the primary button color to purple"
What you did:
"I changed $primary: $blue-600; to $primary: #9333ea; in _variables.scss"
What you expected: "Buttons should be purple"
What actually happened: "Buttons are still blue"
Error messages (if any): Copy the full error message from terminal
What you've tried: "I ran npm run build and refreshed the browser"
Environment:
node --version)npm --version)Read the docs:
Search online:
Ask in communities:
Remember: Everyone gets stuck sometimes. Be patient with yourself, read error messages carefully, and test changes one at a time. You'll get through it!