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
我的 CLI 版本是 4.5.8。
我正在尝试安装 Vuetify,但出现了此错误。
有的请帮我修正这个错误。
>vue add vuetify
� Installing vue-cli-plugin-vuetify...
+ vue-cli-plugin-vuetify@2.0.7
updated 1 package in 27.591s
63 packages are looking for funding
run `npm fund` for details
✔ 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 (C:\Program Files\nodejs\node_modules\@vue\cli\node_modules\jscodeshift\src\Collection.js:213:13)
at injectOptions (C:\Program Files\nodejs\node_modules\@vue\cli\lib\util\codemods\injectOptions.js:15:6)
at runTransformation (C:\Program Files\nodejs\node_modules\@vue\cli\node_modules\vue-codemod\dist\src\run-transformation.js:61:17)
at C:\Program Files\nodejs\node_modules\@vue\cli\lib\Generator.js:290:23
at Array.forEach (<anonymous>)
at Generator.resolveFiles (C:\Program Files\nodejs\node_modules\@vue\cli\lib\Generator.js:276:24)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Generator.generate (C:\Program Files\nodejs\node_modules\@vue\cli\lib\Generator.js:175:5)
at async runGenerator (C:\Program Files\nodejs\node_modules\@vue\cli\lib\invoke.js:111:3)
at async invoke (C:\Program Files\nodejs\node_modules\@vue\cli\lib\invoke.js:92:3)
此错误是由 jscodeshift
驱动的脚本引起的,该脚本旨在更新实例化 Vue.js 实例,以便它了解 vuetify。
我在使用 Vue.js v3 尝试将 vuetify 添加到项目时遇到此错误。
不幸的是,在撰写本文时 vuetify
不支持 Vue.js v3 - https://vuetifyjs.com/en/introduction/roadmap/#v32e0-28titan29
因此,如果是这种情况,唯一可能的解决方案是切换到 Vue.js v2
在 运行
之前更新您的 main.js
vue add vuetify
Main.js(Vue 2)
new Vue({
render: h => h(App)
}).$mount("#app");
Post 安装
new Vue({
vuetify,
render: h => h(App)
}).$mount('#app
我的 CLI 版本是 4.5.8。 我正在尝试安装 Vuetify,但出现了此错误。 有的请帮我修正这个错误。
>vue add vuetify
� Installing vue-cli-plugin-vuetify...
+ vue-cli-plugin-vuetify@2.0.7
updated 1 package in 27.591s
63 packages are looking for funding
run `npm fund` for details
✔ 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 (C:\Program Files\nodejs\node_modules\@vue\cli\node_modules\jscodeshift\src\Collection.js:213:13)
at injectOptions (C:\Program Files\nodejs\node_modules\@vue\cli\lib\util\codemods\injectOptions.js:15:6)
at runTransformation (C:\Program Files\nodejs\node_modules\@vue\cli\node_modules\vue-codemod\dist\src\run-transformation.js:61:17)
at C:\Program Files\nodejs\node_modules\@vue\cli\lib\Generator.js:290:23
at Array.forEach (<anonymous>)
at Generator.resolveFiles (C:\Program Files\nodejs\node_modules\@vue\cli\lib\Generator.js:276:24)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Generator.generate (C:\Program Files\nodejs\node_modules\@vue\cli\lib\Generator.js:175:5)
at async runGenerator (C:\Program Files\nodejs\node_modules\@vue\cli\lib\invoke.js:111:3)
at async invoke (C:\Program Files\nodejs\node_modules\@vue\cli\lib\invoke.js:92:3)
此错误是由 jscodeshift
驱动的脚本引起的,该脚本旨在更新实例化 Vue.js 实例,以便它了解 vuetify。
我在使用 Vue.js v3 尝试将 vuetify 添加到项目时遇到此错误。
不幸的是,在撰写本文时 vuetify
不支持 Vue.js v3 - https://vuetifyjs.com/en/introduction/roadmap/#v32e0-28titan29
因此,如果是这种情况,唯一可能的解决方案是切换到 Vue.js v2
在 运行
之前更新您的 main.jsvue add vuetify
Main.js(Vue 2)
new Vue({
render: h => h(App)
}).$mount("#app");
Post 安装
new Vue({
vuetify,
render: h => h(App)
}).$mount('#app