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
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
plop-prettier
✓ plop.load('plop-prettier')
✗ require('plop-prettier')
Loaded via plop.load, not direct require; used in plopfile.js.
pretty-add action type
✓ type: 'pretty-add'
✗ type: 'prettier' or type: 'plop-prettier'
The action type string is 'pretty-add', not the package name.
options object
✓ plop.load('plop-prettier', { tabWidth: 4 })
✗ plop.load('plop-prettier', { prettier: { tabWidth: 4 } })
Options are passed as a single object directly to plop.load, not nested under a 'prettier' key.
Example plopfile loading plop-prettier and using 'pretty-add' action type to create a component file.
// plopfile.js
module.exports = function (plop) {
plop.load('plop-prettier', { tabWidth: 4 });
plop.setGenerator('component', {
description: 'Create a new component',
prompts: [
{
type: 'input',
name: 'name',
message: 'Component name'
}
],
actions: [
{
type: 'pretty-add',
path: 'src/{{pascalCase name}}/{{pascalCase name}}.js',
template: `import React from 'react';
const {{pascalCase name}} = () => {
return <div>{{pascalCase name}}</div>;
};
export default {{pascalCase name}};`
}
]
});
};
Errors
Common errors & fixes
Error: Cannot find module 'prettier'
Missing peer dependency 'prettier'
TypeError: plop.load is not a function
Trying to run plop.load in a context where plop is not the plop API object
fixEnsure plop.load is called inside the plopfile export function: module.exports = function(plop) { plop.load('plop-prettier'); } Unrecognized action type: prettier-add
Using wrong action type string
fixUse 'pretty-add' (with underscore, not hyphen).
Audit
Dependencies
prettierrequiredpeer dependency required for formatting