kazupon / vue-cli-plugin-p11n

:electric_plug: Vue CLI 3 plugin to pluginize your Vue project
MIT License
113 stars 13 forks source link

Vue-Cli 4 Generated project Error while trying to vue add p11n #38

Open Codermar opened 4 years ago

Codermar commented 4 years ago

I got the errors below while trying to "vue add p11n" to a newly created project with @vue/cli 4.0.5

ā”€ā–Ŗ vue add p11n WARN There are uncommited changes in the current repository, it's recommended to commit or stash them first. ? Still proceed? Yes

šŸ“¦ Installing vue-cli-plugin-p11n...

core-js@2.6.10 postinstall /usr/local/puppeteer-platform/packages/puppeteer-ui-plugin-forms/node_modules/@babel/runtime-corejs2/node_modules/core-js node postinstall || echo "ignore"

core-js@2.6.10 postinstall /usr/local/puppeteer-platform/packages/puppeteer-ui-plugin-forms/node_modules/@vuepress/core/node_modules/core-js node postinstall || echo "ignore"

vuepress@1.2.0 postinstall /usr/local/puppeteer-platform/packages/puppeteer-ui-plugin-forms/node_modules/vuepress opencollective-postinstall || true

šŸš€ Invoking generator for vue-cli-plugin-p11n... āš ļø author is undefined in package.json ā ‹ Running completion hooks...error: Assignment to property of function parameter 'Vue' (no-param-reassign) at src/index.js:9:3: 7 | */ 8 |

9 | Vue.prototype.$add = (a, b) => a + b; | ^ 10 | 11 | / 12 | NOTE:

error: 'vue' should be listed in the project's dependencies, not devDependencies (import/no-extraneous-dependencies) at src/main.js:1:1:

1 | import Vue from 'vue'; | ^ 2 | import App from './App.vue'; 3 | import './plugin'; 4 |

error: 'vue' should be listed in the project's dependencies, not devDependencies (import/no-extraneous-dependencies) at src/plugin.js:6:1: 4 | */ 5 |

6 | import Vue from 'vue'; | ^ 7 | import plugin from './index'; 8 | 9 | Vue.use(plugin);

3 errors found.

Codermar commented 4 years ago

Update: Moving vue to dependencies and adding eslint disable in index.js seems to make the project work. Still checking if anything else might be broken.

 // eslint-disable-next-line no-param-reassign
  Vue.prototype.$add = (a, b) => a + b;