{"id":18773,"library":"sass-include-paths","title":"sass-include-paths","description":"Generates include path arrays for node-sass from npm, bower, Ruby gem, and Bundler sources. Version 4.10.0 (stable, no recent updates). Enables interoperability between Ruby Sass, LibSass, and Eyeglass by scanning node_modules, bower_components, and gem directories for SCSS/SASS packages. Differentiator: provides both async (Promise-based) and sync variants for tools like Gulp. Note: Ruby gem scanning requires a Ruby environment; bower support is legacy.","status":"active","version":"4.10.0","language":"javascript","source_language":"en","source_url":"https://github.com/strarsis/sass-include-paths","tags":["javascript","sass","scss","include","paths","path","npm"],"install":[{"cmd":"npm install sass-include-paths","lang":"bash","label":"npm"},{"cmd":"yarn add sass-include-paths","lang":"bash","label":"yarn"},{"cmd":"pnpm add sass-include-paths","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM default export is an object with methods; named imports work. CJS require works for sync methods.","wrong":"const nodeModulesSync = require('sass-include-paths').nodeModulesSync","symbol":"nodeModulesSync","correct":"import { nodeModulesSync } from 'sass-include-paths'"},{"note":"Async method returns a Promise. In ESM, await or use .then().","wrong":"const nodeModules = require('sass-include-paths').nodeModules","symbol":"nodeModules","correct":"import { nodeModules } from 'sass-include-paths'"},{"note":"Default export is an object; do not import as default.","wrong":"import rubyGemsBundle from 'sass-include-paths'","symbol":"rubyGemsBundle","correct":"import { rubyGemsBundle } from 'sass-include-paths'"},{"note":"All methods are on the default export object, not separate files.","wrong":"const bowerComponentsSync = require('sass-include-paths/bowerComponentsSync')","symbol":"bowerComponentsSync","correct":"import { bowerComponentsSync } from 'sass-include-paths'"}],"quickstart":{"code":"import { nodeModulesSync, rubyGemsSync } from 'sass-include-paths';\n\nconst includePaths = []\n  .concat(nodeModulesSync())\n  .concat(rubyGemsSync());\n\nconsole.log('Include paths:', includePaths);\n\n// Usage with node-sass:\n// const sass = require('node-sass');\n// const result = sass.renderSync({\n//   file: 'main.scss',\n//   includePaths: includePaths\n// });\n// console.log(result.css.toString());","lang":"typescript","description":"Shows how to synchronously generate include paths from npm and Ruby gems, then use them with node-sass."},"warnings":[{"fix":"Avoid relying on bowerComponents or bowerComponentsSync if possible.","message":"bower support is legacy and may be removed in future versions.","severity":"gotcha","affected_versions":">=4.0.0"},{"fix":"Ensure Ruby and gems are installed and PATH is set correctly.","message":"Ruby gem scanning requires a working Ruby environment and may fail silently if gems are not activated.","severity":"gotcha","affected_versions":">=4.0.0"},{"fix":"Use the Sync variant or await the async method.","message":"Async methods return Promises and must be awaited or chained; calling them synchronously will not return the array.","severity":"gotcha","affected_versions":">=4.0.0"},{"fix":"Manually add paths for scoped packages or other package managers.","message":"The module does not support custom package managers or scoped npm packages automatically.","severity":"gotcha","affected_versions":">=4.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run npm install sass-include-paths --save-dev and use correct import (see imports section).","cause":"Package not installed or import path incorrect.","error":"Cannot find module 'sass-include-paths'"},{"fix":"Use import { nodeModulesSync } from 'sass-include-paths'","cause":"Using default import incorrectly or destructuring from wrong object.","error":"TypeError: nodeModulesSync is not a function"},{"fix":"Verify the bundle path (default ./vendor/bundle) or customize via options.","cause":"Ruby gem bundle path does not exist or is misconfigured.","error":"Error: ENOENT: no such file or directory, scandir '/path/to/gems'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}