2

Every day, I come to my office, launch my IDE (Code - OSS) and run npm run watch. Every day it works like a charm. But not today. Oddly enough, today running npm run watch fires this error:

ERROR in multi vue Module not found: Error: Can't resolve 'vue' in '/home/TopSecretUser/Code/Local/TopSecretProject/11.11.2020/dev' @ multi vue /js/vendor[0]

ERROR in ./resources/js/app.js Module not found: Error: Can't resolve 'vue' in '/home/me/Code/Local/TopSecretProject/11.11.2020/dev/resources/js' @ ./resources/js/app.js 3:13-16 4:0-22 6:0-3 85:14-17 @ multi ./resources/js/app.js ./resources/css/app.css

My app.js starts with the following lines:

require("./bootstrap");

import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);

...

I haven't made any changes from yesterday to today, so I am totally confused. I tried some fixings but nothing worked. Does anyone have any suggestion how i can fix this? I am using [email protected].

3
  • 1
    i think the node_modules folder has some issues, try to remove it and rerun npm i Commented Nov 11, 2020 at 9:25
  • Thx @BoussadjraBrahim, that fiexd it! But how can this happen? Are there any understandable reasons for this issue? Commented Nov 11, 2020 at 9:31
  • 1
    probably it is an external action that affected your node_modules folder like virus or if you rename/delete/move something inside that folder Commented Nov 11, 2020 at 9:34

2 Answers 2

1

You could delete the node_modules which could be affected by an external action like deletion/moving or you mis-installed a module, then rerun :

npm install

this will fetch the dependencies in package.json and install them, you should always install a module by adding --save or --save-dev flag with npm i like npm i some-module --save

Sign up to request clarification or add additional context in comments.

Comments

0

after a while I found the solution , just import component as this:

Vue.component('Date',required('components/Date.vue'));

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.