Problem Description:
When writing a vue project, the terminal reports an error:
ERROR in index
Module not found: Error: Can't resolve '···File Address···\src\index\main.js' in '···File Address···'
ERROR in subpage
Module not found: Error: Can't resolve '···File Address···\src\subpage\main.js' in '···File Address···'
webpack compiled with 2 errors
Specifically as shown in the figure:
First eliminate the error of importing files by App.vue, and add Vue.config.productionTip = false in main.js//Close the production prompt of Vue, and eliminate all the reasons for the above errors.
I suspect that the configuration of the vue.config.js file is wrong. According to the tutorial, I replaced the content in vue.config.js with the code block in the official website pages (still reporting an error~)
Brothers, this cannot be changed in the new version!
solve:
1. Use the default configuration.
2. Then add lintOnSave:false on the next line of true//turn off syntax checking
3. Ctrl + C to close the project, and then run the npm run serve command again
Finally, it ran successfully (in fact, the mistake was that I changed the default file randomly...)