{"id":16851,"library":"mbake","title":"MetaBake CLI","description":"MetaBake (mbake) CLI is an open-source, extensible low-code productivity bundler and builder designed for creating static websites and web applications, leveraging Pug and JAMstack principles. As of version 8.5.4, it provides out-of-the-box features like Pug compilation, livereload, Sass/SCSS compilation with autoprefixing, and TypeScript compilation. Its core differentiator is simplifying web development by abstracting away complex build configurations, allowing developers to write cleaner code quicker for various projects including static sites, custom elements, CMS, e-commerce, and CRUD applications. It facilitates a gradual adoption approach, enabling rapid development with a focus on simplicity and efficiency. While it doesn't specify a strict release cadence, it indicates active development. The tool focuses on generating static content that can be served efficiently via CDNs, using standard web technologies like HTML, CSS, and JavaScript, making it accessible to a broad audience.","status":"active","version":"8.5.4","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","pug","static gen","low-code","CRUD"],"install":[{"cmd":"npm install mbake","lang":"bash","label":"npm"},{"cmd":"yarn add mbake","lang":"bash","label":"yarn"},{"cmd":"pnpm add mbake","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"mbake is primarily a global CLI tool. It is installed via npm globally and invoked directly from the terminal, not imported as a JavaScript module.","wrong":"import { mbake } from 'mbake'","symbol":"mbake (Global CLI)","correct":"npm i -g mbake"},{"note":"The `-w` flag activates the watcher, which includes livereload and starts a local development webserver. The `.` specifies the current directory to watch.","wrong":"mbake --watch","symbol":"Watcher with Livereload","correct":"mbake -w ."},{"note":"The `-s` flag triggers Sass/SCSS compilation. Ensure you have a `style.yaml` file in your `assets` folder specifying the SCSS files to compile.","wrong":"mbake --sass","symbol":"Sass Compilation","correct":"mbake -s ."},{"note":"The `-t` flag compiles TypeScript files (`.ts`) in the specified directory, converting them to JavaScript.","wrong":"mbake --typescript","symbol":"TypeScript Compilation","correct":"mbake -t ."}],"quickstart":{"code":"npm i -g mbake\ncd my-website-folder\n# Create index.pug and dat.yaml files here\n# Example index.pug:\n/* header\nbody\n   p Hello #{key1} */\n# Example dat.yaml:\n/* key1: World */\nmbake -w . # Starts watcher, livereload, and local server","lang":"bash","description":"This quickstart demonstrates how to install mbake globally and start a basic website with livereload using Pug and a data YAML file."},"warnings":[{"fix":"Upgrade your Node.js installation to version 14.0.0 or newer using a version manager like `nvm` or by downloading the latest LTS from nodejs.org.","message":"MetaBake requires Node.js version 14.0.0 or higher. Using an older Node.js version may lead to installation failures or unexpected runtime errors.","severity":"gotcha","affected_versions":"<14.0.0"},{"fix":"Ensure `index.pug` and `dat.yaml` are correctly placed in the directory you are compiling. Refer to the documentation for specific file structure requirements for different features (e.g., Sass, TypeScript).","message":"For basic site compilation, `mbake` expects `index.pug` and `dat.yaml` files to be present in the root of the target directory. Missing these files will result in no output HTML.","severity":"gotcha","affected_versions":">=8.0.0"},{"fix":"Always install `mbake` globally using `npm i -g mbake` to ensure the `mbake` command is available in your system's PATH.","message":"mbake is designed as a global CLI tool. Attempting to use it as a local `npm run` script without global installation or with an incorrect path may fail.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-22T00:00:00.000Z","next_check":"2026-07-21T00:00:00.000Z","problems":[{"fix":"Run `npm i -g mbake` to install the package globally. If already installed, verify your system's PATH environment variable.","cause":"The mbake package was not installed globally, or its installation path is not in the system's PATH.","error":"'mbake' command not found"},{"fix":"Update your Node.js to version 14.0.0 or newer. For example, using nvm: `nvm install 16 && nvm use 16`.","cause":"The currently active Node.js version is below the minimum requirement (>=14.0.0) specified by mbake.","error":"Error: Node.js version X.Y.Z is not supported."},{"fix":"Ensure you are running `mbake` from the root directory of your project, where `index.pug` and `dat.yaml` are located, or specify the correct path, e.g., `mbake -w ./my-site`.","cause":"The `mbake` command was executed in a directory that does not contain an `index.pug` file, or the path specified to `mbake` was incorrect.","error":"Pug compilation failed: No such file or directory, 'index.pug'"}],"ecosystem":"npm","meta_description":null}