vuejs / vue-cli

🛠️ webpack-based tooling for Vue.js Development
https://cli.vuejs.org/
MIT License
29.75k stars 6.33k forks source link

apply is not a function at Generator.Plugins.forEach #4024

Closed CodeSpent closed 5 years ago

CodeSpent commented 5 years ago

Version

3.7.0

Reproduction link

https://github.com/CodeSpent/CodeSpent.dev

Environment info

Environment Info:

  System:
    OS: Windows 10
    CPU: (4) x64 Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
  Binaries:
    Node: 10.15.3 - C:\Program Files\nodejs\node.EXE
    Yarn: Not Found
    npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: 44.17763.1.0
  npmPackages:
    @fortawesome/vue-fontawesome: ^0.1.6 => 0.1.6
    @sagalbot/vueable: 0.0.3 => 0.0.3
    vue: ^2.5.11 => 2.6.10
    vue-chartjs: ^3.4.2 => 3.4.2
    vue-cli-webpack:  1.0.0
    vue-github-api: ^0.1.7 => 0.1.7
    vue-hot-reload-api:  2.3.3
    vue-loader: ^13.0.5 => 13.7.3
    vue-resource:  1.5.1
    vue-style-loader:  3.1.2
    vue-template-compiler: ^2.4.4 => 2.6.10
    vue-template-es2015-compiler:  1.9.1
    vuetify: ^1.5.14 => 1.5.14
    vuex: ^3.1.1 => 3.1.1
  npmGlobalPackages:
    @vue/cli: Not Found

Steps to reproduce

use vue add router

What is expected?

vue add router

What is actually happening?


? Use history mode for router? (Requires proper server setup for index fallback in production) No
(node:4328) UnhandledPromiseRejectionWarning: TypeError: apply is not a function
    at Generator.plugins.forEach (C:\Users\hanfo\AppData\Roaming\npm\node_modules\@vue\cli\lib\Generator.js:103:7)
    at Array.forEach (<anonymous>)
    at new Generator (C:\Users\hanfo\AppData\Roaming\npm\node_modules\@vue\cli\lib\Generator.js:101:13)
    at Function.runGenerator (C:\Users\hanfo\AppData\Roaming\npm\node_modules\@vue\cli\lib\invoke.js:123:21)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:4328) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)(node:4328) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```

<!-- generated by vue-issues. DO NOT REMOVE -->
CodeSpent commented 5 years ago

This also occurs on my desktop which is a similar environment. Is it a dependency not compatible with Windows possibly?

haoqunjiang commented 5 years ago

This error may occur when your node_modules does not contain any actual Vue CLI plugins. Please rerun npm install and try again.

We need to improve the error message, though.

pksunkara commented 5 years ago

@sodatea Can you close this? Fixed by #4242

haoqunjiang commented 5 years ago

😂forgot to put the fix keyword before each issue id.