Registry / node-bourbon

node-bourbon

JSON →
library4.2.8jsnpmunverified

Node Bourbon is a `node-sass` wrapper for the now-unmaintained Bourbon Sass library. It provided a convenient way for Node.js developers to integrate Bourbon's Sass mixins and functions into their projects using `node-sass` (which itself is a binding for LibSass). The package reached its last stable version, 4.2.8, in March 2016. Since then, both `node-bourbon` and the original Bourbon project by thoughtbot have been abandoned. The original Bourbon library recommends transitioning to native CSS. Consequently, `node-bourbon` is not compatible with modern Sass compilers like Dart Sass or recent versions of Node.js, making it unsuitable for new projects and difficult to maintain in existing ones.

npm install node-bourbon
INSTALL
IMPORT
SIG · NODE-BOURBON
N
node-bourbon
javascriptv4.2.8
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

bourbon
const bourbon = require('node-bourbon');
import bourbon from 'node-bourbon';
This package is CommonJS-only and does not support ES modules.
bourbon.includePaths
require('node-bourbon').includePaths
require('node-bourbon')
Accesses the array of Bourbon's Sass include paths directly.
bourbon.with()
require('node-bourbon').with('path/to/extra/scss')
require('node-bourbon').with
The `with()` function must be called to return the augmented array of paths.

Demonstrates basic integration of `node-bourbon` with a Gulp build process using `gulp-sass` for compiling Sass files, including Bourbon's mixins.

const gulp = require('gulp'); const sass = require('gulp-sass')(require('sass')); // Using 'sass' for modern compatibility, though node-bourbon expected node-sass const path = require('path'); gulp.task('sass-compile', function () { return gulp.src('src/styles/*.scss') .pipe(sass({ // The primary way to include Bourbon paths is via includePaths includePaths: require('node-bourbon').includePaths // Alternatively, to include additional directories alongside Bourbon's: // includePaths: require('node-bourbon').with(path.join(__dirname, 'src/components')) }).on('error', sass.logError)) .pipe(gulp.dest('dist/css')); }); // To run this, ensure you have gulp, gulp-sass, sass (Dart Sass) and node-bourbon installed. // You'll also need a 'src/styles/main.scss' file, e.g.: // // /* src/styles/main.scss */ // @import "bourbon"; // // body { // @include display(flex); // background-color: #f0f0f0; // } // // Run with: `npx gulp sass-compile`
Debug
Known issues
breakingThe `node-bourbon` package is effectively abandoned, with its last release over 10 years ago. It is built to wrap an older, also unmaintained version of the Bourbon Sass library (v4.x). Modern Sass environments (Dart Sass) and newer Node.js versions are not officially supported.
fix
Migrate to native CSS, modern Sass (Dart Sass), or a currently maintained utility-first CSS framework. If Bourbon features are strictly needed, consider the official `bourbon` npm package (though that project is also unmaintained and recommends native CSS).
affects: >=4.2.8
breakingThis package exclusively relies on `node-sass` (LibSass), which itself is deprecated and no longer actively developed. It will not work with the modern `sass` package (Dart Sass) without careful configuration or potential breakage.
fix
Replace `node-sass` with `sass` (Dart Sass) and refactor Sass code to remove `node-bourbon` dependencies.
affects: >=4.2.8
gotchaEarlier versions and even 4.2.7/4.2.8 had issues with returning incorrect or nested Bourbon paths, potentially leading to 'file not found' errors during Sass compilation.
fix
Ensure `node-bourbon` is at version `4.2.8` to mitigate known path issues, though this is a very old version. If issues persist, manually verify `bourbon.includePaths` output.
affects: <=4.2.7
gotcha`node-bourbon` is explicitly NOT tested against the Ruby version of Sass. Using it with `grunt-contrib-sass` (which typically invokes Ruby Sass) may lead to unexpected behavior or compilation failures.
fix
Always use `node-bourbon` with `node-sass` or `gulp-sass` (LibSass-based compilers) as recommended. Avoid `grunt-contrib-sass` when using this package.
affects: >=1.0.0
Errors
Common errors & fixes
Error: File to import not found or unreadable: bourbon
The Sass compiler (node-sass) could not locate Bourbon's stylesheet files. This often happens if `node-bourbon`'s `includePaths` are not correctly passed to the Sass compiler's options, or if `node-bourbon` itself is not installed correctly.
fix
Ensure `require('node-bourbon').includePaths` (or `.with()`) is correctly assigned to your Sass compiler's `includePaths` option in your build configuration (e.g., Gulp, Grunt, Webpack). Verify `node_modules/node-bourbon` exists and contains the expected files.
Invalid CSS after "v": expected 1 selector or at-rule, was "var path = require("
This error occurs when a JavaScript file is mistakenly treated as a Sass file by the compiler. It typically happens if your build tool's glob pattern for Sass files accidentally includes `node-bourbon`'s `index.js` or another JavaScript file.
fix
Review your `gulp.src()`, `grunt.initConfig().files`, or Webpack loader configurations to ensure only actual `.scss` or `.sass` files are processed by the Sass compiler. Exclude `node_modules` directories explicitly if necessary.
WARNING: [Bourbon] [Deprecation] *** is deprecated and will be removed in 5.0.0.
You are using a deprecated Bourbon mixin or function from an older version of Bourbon that `node-bourbon` wraps (Bourbon v4.x). These deprecation warnings were present in the original Bourbon library.
fix
Update your Sass code to use the recommended alternatives for the deprecated Bourbon features. Given that Bourbon itself is unmaintained, this might involve migrating away from Bourbon entirely to native CSS or more modern Sass practices.
Upgrade
Version history
4.2.8latest on npm
Audit
Dependencies
node-sassrequiredCore dependency for compiling Sass; this package wraps Bourbon for node-sass (LibSass).
Agent activity
2 hits · last 30 days
node
2
Resources
node-bourbon — npm install node-bourbon · libregistry