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

this.installDependencies is not a function #1293

Closed
nazarhussain opened this issue May 4, 2021 · 3 comments
Closed

this.installDependencies is not a function #1293

nazarhussain opened this issue May 4, 2021 · 3 comments
Labels
needs triage Awaiting triage

Comments

@nazarhussain
Copy link

Installing dependencies is any generator is failing.

public install(): void {
    this.installDependencies({ npm: true, bower: false, yarn: false, skipMessage: false });
}

It throws the following error.

(node:58529) UnhandledPromiseRejectionWarning: TypeError: this.installDependencies is not a function
   ......
    at Object.<anonymous> (node_modules/yeoman-generator/lib/index.js:1009:25

This probably caused because the actions/install is not registered to the Generator class.

generator/lib/index.js

Lines 1408 to 1413 in d8dfd10

// Mixin the actions modules
_.extend(Generator.prototype, require('./actions/help'));
_.extend(Generator.prototype, require('./actions/spawn-command'));
_.extend(Generator.prototype, require('./actions/fs'));
_.extend(Generator.prototype, require('./actions/package-json'));
Generator.prototype.user = require('./actions/user');

This above code block is missing.

_.extend(Generator.prototype, require('./actions/install'));
@mshima
Copy link
Member

mshima commented May 4, 2021

It is not included by default anymore.
https://github.com/yeoman/generator/releases/tag/v5.0.0

@nazarhussain
Copy link
Author

Thanks for the information @mshima

@schorfES
Copy link

schorfES commented May 5, 2021

The documentation is not up to date and quite misleading

jithine added a commit to screwdriver-cd/generator-screwdriver that referenced this issue Jun 1, 2021
Install dependencies is not included by default any more
(yeoman/generator#1293)
jithine added a commit to screwdriver-cd/generator-screwdriver that referenced this issue Jun 2, 2021
* fix: package.json to reduce vulnerabilities

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-GLOBPARENT-1016905

* fix: update generator-environment & generator-test

Install dependencies is not included by default any more
(yeoman/generator#1293)

* use install dependencies

Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Co-authored-by: Jithin Emmanuel <jithine@verizonmedia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Awaiting triage
Projects
None yet
Development

No branches or pull requests

3 participants