This dependency was not found

Viewed 6382

When i try to npm run serve it stops at 98% and :

ERROR  
Failed to compile with 1 error                                                                                                   
This dependency was not found:

* @/components/HelloWorld.vue in ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./src/views/Home.vue?vue&type=script&lang=js

To install it, you can run: npm install --save @/components/HelloWorld.vue

I looked up for some sources but never helped. Even installing HelloWorld.vue turns an error.

2 Answers

It looks like one of your files is trying to load a local component called HelloWorld.vue and it may not exist in your project structure. You shouldn't try to "install" it, but rather head to the Home.vue file where this error is being triggered from (see Home.vue at th end of the error message?). Then ask yourself, do you actually want to load HelloWorld.vue?

I imagine you're following some sort of "getting started with Vue" guide and you've been instructed to include that file. You'll have to either create that file in the {YOUR_PROJECT}/src/components/ folder, or remove the code that's trying to load it.

Alternatively, this could be a configuration error in which you're trying to use the @ alias but it hasn't been setup in webpack properly. Please include more info if this doesn't solve your problem.

Maybe Vue Js cli is not installed on server

// to install vue on ubuntu
npm install -g @vue/cli
// check if it was installed successfully
vue --version
@vue/cli 4.1.2
Related