I use externals modules in vue.config.js
..., chainWebpack: config => { config.externals(["vue", "vuex", "vue-router"]); }, ...
after running npm serve script i get this error:

If you install vue locally, then the error goes away, but then a render error appears:

In the webpack config, the value of "libraryTarget" is set to "system".
How to fix it?