admin管理员组文章数量:1302970
I am trying to get an app up and running with Vue 2 and everything was fine until I tried using the node-sass
and sass-loader
packages. I started getting errors and after investigation, it looks like I need to be using webpack
5+ for the latest node-sass
package to work. After poking around it looks like when I created the project it defaulted to webpack
version 4.46.0.
I updated my vue-cli
to the latest version as per the instructions on the official page and then tried re-initializing a new project and still have the same issue. Currently, I have @vue/cli 4.5.12
which looks to be the latest (I think).
I am initializing the app with vue create <app-name>
and I am using the default configs. I did find this page which says "migrating from v4" which perhaps implies there might be a higher version of vue-cli
but again I followed all the instructions to no avail, so not sure if I am just missing something here.
I am pretty novice in Vue and not sure what additional info I should provide to make this useful, but I've searched all over and for the life of me cannot figure out what is going on.
I am trying to get an app up and running with Vue 2 and everything was fine until I tried using the node-sass
and sass-loader
packages. I started getting errors and after investigation, it looks like I need to be using webpack
5+ for the latest node-sass
package to work. After poking around it looks like when I created the project it defaulted to webpack
version 4.46.0.
I updated my vue-cli
to the latest version as per the instructions on the official page and then tried re-initializing a new project and still have the same issue. Currently, I have @vue/cli 4.5.12
which looks to be the latest (I think).
I am initializing the app with vue create <app-name>
and I am using the default configs. I did find this page which says "migrating from v4" which perhaps implies there might be a higher version of vue-cli
but again I followed all the instructions to no avail, so not sure if I am just missing something here.
I am pretty novice in Vue and not sure what additional info I should provide to make this useful, but I've searched all over and for the life of me cannot figure out what is going on.
Share Improve this question asked Mar 29, 2021 at 0:08 djvarolidjvaroli 1,4231 gold badge13 silver badges34 bronze badges 1- Same exact issue – secondman Commented Apr 5, 2021 at 10:46
1 Answer
Reset to default 9From what I found out on GitHub, the latest stable version - 4.5.12 - of Vue CLI still uses Webpack 4: https://github./vuejs/vue-cli/blob/v4.5.12/package.json .
Considering that, the easiest solution in my opinion would be to just downgrade sass-loader to version 10 with npm install sass-loader@10
for example, as suggested here: https://stackoverflow./a/66087132/1505369.
You could try using a beta version of vue-cli, as I tried, by updating both @vue/cli-service
and, I believe, all the vue-cli plugins to version 5.0.0-beta.0, with npm install @vue/[email protected] @vue/[email protected] @vue/[email protected] @vue/[email protected]
. It should end up installing and using Webpack 5. For me personally though, it hasn't really solved the issue, as the new error occurred:
ERROR TypeError: The 'pilation' argument must be an instance of Compilation TypeError: The 'pilation' argument must be an instance of Compilation
// ...
本文标签: javascriptVue cli using webpack 4 instead of 5 by defaultStack Overflow
版权声明:本文标题:javascript - Vue cli using webpack 4 instead of 5 by default - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741690200a2392676.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论