question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not able to generate new component

See original GitHub issue

Getting exception while running npm run generate component Square

Output:

npm run generate component Square 

> react-daisyui@2.0.1 generate
> plop "component" "Square"

/Users/****/Desktop/Temp/react-daisyui/node_modules/plop/bin/plop.js:3
import { Plop, run } from "../src/plop.js";
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at Module._compile (internal/modules/cjs/loader.js:892:18)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1025:10)
    at internal/main/run_main_module.js:17:11

Expected: create new component

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:12

github_iconTop GitHub Comments

1reaction
bannarisoftwarescommented, Apr 28, 2022

@bannarisoftwares I just tested with Node 12.13.0 and got the same error as you. For plop to work please upgrade to at least Node 14 or above. I upgraded from 12.13.0 to 14.19.1 and was able to generate a component!

Working great after updated to v14… Thank you for the support @benjitrosch

1reaction
benjitroschcommented, Apr 28, 2022

Thanks @bannarisoftwares. I will take a look!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular CLI generate component issue
Try ng g c my-component --module app.module (or --module ../module.app , or however many parent levels are needed). – Andy King.
Read more >
Cannot create components with CLI on Windows #7960
Create a new project using ng new PROJECT-NAME · Create an apps folder inside of the src folder. · Move everything in src/app...
Read more >
ng generate component using the CLI
ng generate component is a simple one-line command which creates different files and a folder, and it references the newly created component ......
Read more >
Angular components overview
Run the ng generate component <component-name> command, where <component-name> is the name of your new component. By default, this command creates the following ......
Read more >
Canvas component overview (contains video) - Power Apps
Learn about how to create reusable components for canvas apps. ... are scoped to the component instance and not shared with the app....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found