Background: I changed the name of the file and many configurations are gone. I can only start again and delete node_modules and package-lock.json. I also found many ways to repeatedly configure the two files. The fastest way is
npm i -D vue
After it was restored later, many problems appeared again. What has been bothering me is the content of the picture below
Background: He reported an error when I ran npm run serve
I also tried many, many methods, delete node_modules, etc. I didn’t succeed, or you run the same error
Until now I have found a way to solve the problem again finally! finally! finally! solved
One more thing to add: pay attention to see whether your previous version is vue2 or vue3. If it is vue2, you can execute npm install -g yarn or npm i -D vue, it may automatically upgrade to vue3 for you, and in the comparison between vue3 and vue2 , the configuration of main.js is different
The running prompt has a warning and reminds you to pay attention to the scaffolding and Vue version issues in main.js
export 'default' (imported as 'Vue') was not found in 'vue'
The premise of encountering the above problem is that you have installed yarn and you only need to run yarn install to succeed! ! !
Solution:
I am not very clear about what yarn is. For details, please refer to
Introduction to Yarn_cangchen@csdn's Blog-CSDN Blog_What is yarn
Install yarn first
npm install -g yarn
Re-execute
yarn install
I tried so many ways and it took me 2 hours to finally get it working on the second night. I'm really happy