Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

instantiatedGenerator.run is not a function #258

Open
houseBetter opened this issue Nov 26, 2023 · 22 comments
Open

instantiatedGenerator.run is not a function #258

houseBetter opened this issue Nov 26, 2023 · 22 comments

Comments

@houseBetter
Copy link

cann't create an app。

image

node and package version

node v18.17.0
npm 9.6.7
yo 5.0.0
generator-generator 5.1.0

System

OS: macOS 12.6
CPU: (8) arm64 Apple M1

@jedaan
Copy link

jedaan commented Dec 1, 2023

getting the same error , any update ?

@ekeel
Copy link

ekeel commented Dec 1, 2023

I'm getting the same error as well.

Error generator 

instantiatedGenerator.run is not a function
Name Version
Node v20.10.0
NPM 10.2.3
yo 5.0.0
generator-generator 5.0.0/5.1.0

System

OS: Windows 11 22H2
CPU: Intel Core i9
RAM: 32GB

@j4k0xb
Copy link

j4k0xb commented Dec 3, 2023

@jonathanwork
Copy link

been getting the same error...

@weshouman
Copy link

Workaround
I had to downgrade yo to get it working, for example

npm install -g [email protected] generator-generator

@ruieloi
Copy link

ruieloi commented Mar 18, 2024

Hey!
Any news about this issue?
Is there another way for this to work except to downgrade? Did the method changed?

Thank you

@takashi013
Copy link

any help ?

@Aiwwa
Copy link

Aiwwa commented Mar 29, 2024

Hello,

I'm also getting same error.
Is this the dead end, or there some hopes ?

Thanks.

@Vladyslav317
Copy link

Hi, any solutions except for downgrading?

@AmroKhatib77
Copy link

hello, any solutions?

@Aiwwa
Copy link

Aiwwa commented May 6, 2024 via email

@JosXa
Copy link

JosXa commented May 7, 2024

Workaround I had to downgrade yo to get it working, for example

npm install -g [email protected] generator-generator

December 20. Project ded?

@NgocLe1001
Copy link

npm install -g [email protected]

Thanks It helps for mac M1 sonoma 14.4.1 (23E224)

@NgocLe1001
Copy link

NgocLe1001 commented May 8, 2024

npm install -g [email protected]

npm install -g [email protected]
I resolved by installing this version. maybe you should try.

@hcl-z
Copy link

hcl-z commented May 16, 2024

Check the yeoman-generator version that you use in your generator. This error is present in version 3. If you use JS to write your generator, try 5.10.0 instead, as higher versions only support esmodule

@aliridha1510
Copy link

any solutions?

@yenoh2
Copy link

yenoh2 commented Jun 28, 2024

I worked through detailed debugging to understand how to write a generator that works with the latest yeoman yo and generator. At this point none of the Yeoman documentation describes how to build a working generator with the latest version. I'm thinking this project needs to be updated in a similar way. Based on my efforts with my generator, it looks like this project needs to refactored to use import instead of require. Here's a fully functioning generator example that uses the latest version of yeoman and the yeoman generator: https://github.com/yenoh2/generator-hac-tf-module

  1. update your package.json adding "type": "module"
  2. Since the newer version uses ESM you need to update your generator use imports instead of 'require' in your index.js file.
    Example:
    import _ from 'lodash';
    import Generator from 'yeoman-generator';
    import askName from 'inquirer-npm-name';
    import { createRequire } from 'module';
    const require = createRequire(import.meta.url);
    // see full example here: https://github.com/yenoh2/generator-hac-tf-module/blob/master/generators/app/index.js
  3. Your export for your extended generator should look like this:
    export default class extends Generator {

@ralphcorrigan
Copy link

Still getting this - is the project dead? Also, has anyone successfully implemented yenoh2's fix?

@LumiereLodi
Copy link

Getting the same error. Any progress so far?

Either the project is dead or we need to get plop using EJS instead of handlebars.

@ralphcorrigan
Copy link

I had to roll back, but that worked. Looks like this version is bust (and the lack of response on the thread suggests the project is too)!

@soumilbaldota
Copy link

Having the same issue.

@jarogamer56
Copy link

jarogamer56 commented Sep 12, 2024

Workaround I had to downgrade yo to get it working, for example

npm install -g [email protected] generator-generator

I´ve tried with this, it works. Thanks @Aiwwa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests