{"id":26339,"library":"roots","title":"Roots","description":"Roots is a fast, simple, and customizable static site compiler, currently in maintenance mode at version 5.2.0. It offers a flexible build pipeline with support for various preprocessors (Jade, Stylus, CoffeeScript, etc.), automatic asset pipeline, and live reload via Browsersync. Roots is no longer actively developed; the team now maintains Spike, a more modern alternative. Roots compiles static sites with minimal configuration and supports project scaffolding via Sprout. It is best suited for small-to-medium projects that don't require server-side rendering.","status":"maintenance","version":"5.2.0","language":"javascript","source_language":"en","source_url":"https://github.com/jenius/roots","tags":["javascript","roots","static"],"install":[{"cmd":"npm install roots","lang":"bash","label":"npm"},{"cmd":"yarn add roots","lang":"bash","label":"yarn"},{"cmd":"pnpm add roots","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Roots is typically used as a CLI tool, not imported programmatically. If you must import it, use ESM syntax.","wrong":"const roots = require('roots')","symbol":"default import","correct":"import roots from 'roots'"},{"note":"ESM-only since v5? Actually roots v5 still supports CJS, but ESM is preferred.","wrong":"const { compile } = require('roots')","symbol":"compile function","correct":"import { compile } from 'roots'"},{"note":"Default export is the Roots constructor. CJS require yields the same object.","wrong":"const Roots = require('roots').default","symbol":"Roots class","correct":"import Roots from 'roots'"}],"quickstart":{"code":"<!-- Install globally -->\nnpm install roots -g\n<!-- Create a new project -->\nroots new my-project\ncd my-project\n<!-- Add a layout and page -->\nmkdir -p views/layouts\ncat > views/layouts/default.jade <<EOF\n!!!\nhtml\n  head\n    title My Site\n  body\n    block content\nEOF\ncat > views/index.jade <<EOF\nextends ./layouts/default.jade\n\nblock content\n  h1 Hello, Roots!\nEOF\n<!-- Add a stylus file -->\nmkdir -p assets/css\ncat > assets/css/main.styl <<EOF\nbody\n  font-family: sans-serif\nEOF\n<!-- Compile -->\nroots compile\n<!-- Output in public/ -->\nls public/","lang":"javascript","description":"Create a new Roots project, add a layout (Jade) and page, a Stylus stylesheet, compile to public/."},"warnings":[{"fix":"Evaluate Spike as a replacement for new projects.","message":"Roots is in maintenance mode. No new features will be added. Consider migrating to Spike (https://github.com/static-dev/spike).","severity":"deprecated","affected_versions":">=5.0.0"},{"fix":"Install ship globally: npm i ship -g, then run: roots compile && ship public -to <target>","message":"roots deploy command removed in v5.0.0. Use ship separately.","severity":"breaking","affected_versions":">=5.0.0"},{"fix":"Update Babel to v6 or remove Babel dependency.","message":"Babel upgraded to v6 in roots v4.0.0. If using Babel, must use Babel 6 or higher.","severity":"breaking","affected_versions":">=4.0.0 <4.0.0"},{"fix":"Either use nvm or change npm global directory: see https://roots.cx/docs/error#eacces-permission-denied","message":"EACCES permission errors when installing roots globally on macOS/Linux.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install globally: npm install -g roots","cause":"Roots not installed or global module not in PATH.","error":"Error: Cannot find module 'roots'"},{"fix":"Install globally: npm install -g roots; ensure npm global bin is in PATH.","cause":"Roots not installed globally or npm bin not in PATH.","error":"Roots: command not found"},{"fix":"Install jade locally: npm install --save-dev jade; or use Pug (rename to .pug and install pug).","cause":"Missing Jade dependency for .jade files.","error":"Error: Cannot find module 'jade'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}