0

I'm trying to implement the plop.js micro framework, but the setGenerator method is always unresolved. I've executed following commands

npm install --save-dev plop
npm install -g plop

I also enabled Coding assistance for Node.js in Webstorm (v2019 3.3), still the methods are inaccessible

module.exports = function(plop)  {
plop.setGenerator('component', {
    description: 'Create a component',
    prompts: [
        {
            type: 'input',
            name: 'name',
            message: 'What is your component name?'
        },
    ],
    actions: [
        {
            type: 'add',
            path: 'src/scenes/screens/{{camelCase name}}/index.js',
            templateFile: 'src/services/dev/plop-templates/index.js.hbs',
        }
    ]
});
};

This file is located in the root of my project like suggested inside the documentation.

Is there any other way to access it from the node_modules?

Lorenzo
  • 185
  • 2
  • 4
  • 16
  • 1
    If im understanding correctly you're trying to access a custom node module from your file system. You can install it like: `npm install -D plop@"./path/to/module"` – amprew May 18 '20 at 11:47
  • Thank you, I've fixed it by reinstalling the node_modules – Lorenzo May 18 '20 at 18:24

0 Answers0