{"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,"search_vec":"'4.10.0':22 'array':8 'async':50 'base':53 'bower':15,39,69 'bundler':19 'compon':40 'differenti':47 'directori':43 'enabl':27 'environ':68 'eyeglass':34 'gem':17,42,63 'generat':5 'gulp':60 'includ':3,6,76 'interoper':28 'javascript':73 'legaci':72 'libsass':32 'like':59 'modul':38 'node':11,37 'node-sass':10 'note':61 'npm':14,79 'packag':46 'path':4,7,77,78 'promis':52 'promise-bas':51 'provid':48 'recent':25 'requir':65 'rubi':16,30,62,67 'sass':2,12,31,74 'sass-include-path':1 'scan':36,64 'scss':75 'scss/sass':45 'sourc':20 'stabl':23 'support':70 'sync':55 'tool':58 'updat':26 'variant':56 'version':21","created_at":"2026-04-25T07:40:02.877868+00:00","updated_at":"2026-04-25T07:40:02.877868+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/strarsis/sass-include-paths","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/sass-include-paths","openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-24","install_tag":null}}