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

"yeoman-generator": "^5.2.0"-this.npmInstall is not a function #1752

Open
FreeWisdom opened this issue Apr 29, 2021 · 1 comment
Open

"yeoman-generator": "^5.2.0"-this.npmInstall is not a function #1752

FreeWisdom opened this issue Apr 29, 2021 · 1 comment

Comments

@FreeWisdom
Copy link

when "yeoman-generator": "^5.2.0" show error Error myvue this.npmInstall is not a function

vue-project % yo myvue
? Your project name vue project
   create package.json
   create src/HelloWord.vue
   create webpack.config.js
   create src/main.js
   create src/index.html
Error myvue 

this.npmInstall is not a function

but "yeoman-generator": "^4.13.0" myvue this.npmInstallcan work,dont show error Error myvue this.npmInstall is not a function

@louis-haddrell
Copy link

Also just encountered this issue.

Apparently, v5.0.0 introduced a breaking change which means the install actions are no longer included by default: https://github.com/yeoman/generator/releases/tag/v5.0.0

To get the functionality back, you can load the install action manually:

const _extend = require("lodash/extend");
const Generator = require("yeoman-generator");
_extend(Generator.prototype, require("yeoman-generator/lib/actions/install"));

Or to avoid using the install actions entirely, switch to the new addDependencies and addDevDependencies functions mentioned in the v5.0.0 release notes.

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

2 participants