Vue-loader reported an inexplicable error?

the test project I did yesterday was supposed to be fine. I copied the files inside to another folder and reported an error at startup.

Error: [vue-loader] vue-template-compiler must be installed as a peer dependency, or a compatible compiler implementation must be passed via options.

the above said to install an equivalent dependency, but did not say which specific dependency, the feeling is very baffling?

Apr.13,2021

re-npm install vue-template-compiler-D is fine


is there a more complete error message?

Emmmm, you can see if your vue version is consistent with your vue-template-compiler version.


this error is usually reported only if the vue version is inconsistent with the vue-template-compiler version;
for example, when you enter the following command to update the vue version

npm install --save vue

as shown in the figure:

The version of

vue is 2.5.22, and the version of VuelytemplateMutual is 2.5.21
all you have to do is to keep the relevant versions consistent.

npm install --save-dev vue-template-compiler@ -sharp vue-template-compilervue

is there a copy of the node_module folder? If there is. Delete direct npm install

Menu