Errors : vue add vuetify

Viewed 411

vue add vuetify

ERROR Error: You cannot call "get" on a collection with no paths. Instead, check the "length" property first to verify at least 1 path exists.

➜  git:(master) ✗ vue add vuetify

  Installing vue-cli-plugin-vuetify...

yarn add v1.22.10
[1/4]   Resolving packages...
[2/4]   Fetching packages...
[3/4]   Linking dependencies...#######################################################################################----] 1133/1170
[4/4]   Building fresh packages...
success Saved 1 new dependency.
info Direct dependencies
└─ vue-cli-plugin-vuetify@2.4.5
info All dependencies
└─ vue-cli-plugin-vuetify@2.4.5
✨  Done in 3.66s.
✔  Successfully installed plugin: vue-cli-plugin-vuetify

? Choose a preset: Default (recommended)

  Invoking generator for vue-cli-plugin-vuetify...
 ERROR  Error: You cannot call "get" on a collection with no paths. Instead, check the "length" property first to verify at least 1 path exists.
Error: You cannot call "get" on a collection with no paths. Instead, check the "length" property first to verify at least 1 path exists.
    at Collection.get (/Users/alpha/.nvm/versions/node/v14.17.3/lib/node_modules/@vue/cli/node_modules/jscodeshift/src/Collection.js:213:13)
    at injectOptions (/Users/alpha/.nvm/versions/node/v14.17.3/lib/node_modules/@vue/cli/lib/util/codemods/injectOptions.js:15:6)
    at runTransformation (/Users/alpha/.nvm/versions/node/v14.17.3/lib/node_modules/@vue/cli/node_modules/vue-codemod/dist/src/runTransformation.js:60:17)
    at /Users/alpha/.nvm/versions/node/v14.17.3/lib/node_modules/@vue/cli/lib/Generator.js:290:23
    at Array.forEach (<anonymous>)
    at Generator.resolveFiles (/Users/alpha/.nvm/versions/node/v14.17.3/lib/node_modules/@vue/cli/lib/Generator.js:276:24)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async Generator.generate (/Users/alpha/.nvm/versions/node/v14.17.3/lib/node_modules/@vue/cli/lib/Generator.js:175:5)
    at async runGenerator (/Users/alpha/.nvm/versions/node/v14.17.3/lib/node_modules/@vue/cli/lib/invoke.js:111:3)
    at async invoke (/Users/alpha/.nvm/versions/node/v14.17.3/lib/node_modules/@vue/cli/lib/invoke.js:92:3)

I've tried again

enter image description here

Now I got this

enter image description here

1 Answers

There must be the following code in the main.js, otherwise the error will occur. So just add this code before installation:

new Vue({
    render: h => h(App),
}).$mount('#app');
Related