When I try to run the application with npm start, I get a following error:
This relative module was not found:
- ./src/router/index.js in ./src/main.js
And this is my main.js:
/ The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './src/router/index.js'
Vue.config.productionTip = false
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
components: { App },
template: '<App/>'
})
And this is my index.js:
import Vue from 'vue';
import VueRouter from 'vue-router';
import Firstpage from "../components/Firstpage.vue";
Vue.use(VueRouter);
const router = new VueRouter ({
mode: "history",
routes: [
{
path: "/",
component: Firstpage
},
]
});
Also my node_modules marked with gray color. I expected this is router problem. How can I solve this problem?
++
This is my project file structure: Project file structure
And actually, I have another problem. I can't get my picture from my assets. I already add this code to my component.
Can someone solve this problem? Thank you.