Today marks my first time delving into the world of vue.js, and as expected, I've encountered an error that has me stumped.
I recently incorporated the v-md-date-range-picker module into my project: (.
The setup instructions provided me with the following steps:
1
npm install --save v-md-date-range-picker
2
<template>
<v-md-date-range-picker></v-md-date-range-picker>
</template>
3
<script>
import Vue from 'vue';
import VMdDateRangePicker from "v-md-date-range-picker";
import "v-md-date-range-picker/dist/v-md-date-range-picker.css";
Vue.use(VMdDateRangePicker);
</script>
After executing the terminal command in my project directory, inserting the necessary code snippets into my HelloWorld.vue page, and including the snippet from step 3 in my main.js
, I checked my package.json
file and saw:
"dependencies": {
"core-js": "^2.6.5",
"v-md-date-range-picker": "^2.6.0",
"vue": "^2.6.10"
},
Despite this, an error message appeared:
Module not found: Error: Can't resolve 'v-md-date-range-picker/dist/v-md-date-range-picker.css' in '/Users/James/Documents/projects/vue-test/src'
Am I overlooking something obvious here?
Edit:
I attempted the suggested solution in the comments below to no avail.
While navigating through the module's main page, I discovered additional instructions:
I assume that you have a working bundler setup e.g. generated by the vue-cli thats capable of loading SASS stylesheets and Vue.js SFC (Single File Components).
I suspect that I may be lacking a functional bundler setup. Upon exploring the node_modules folder, specifically the module itself, I noticed the absence of a dist folder. Instead, only .scss files were present.
This leads me to believe that I need to build this project first.
How should I proceed?
My initial assumption was that running it in the browser would handle this automatically, but evidently, that is not the case.
Edit 2:
Following some online research, I came across the command:
$ npm run build.
Executing this command resulted in the following error:
This dependency is not found, To install it, you can run: npm install --save v-md-date-range-picker/dist/v-md-date-range-picker.css
Running said command led me to encounter another error:
Could not install from "v-md-date-range-picker/dist/v-md-date-range-picker.css" as it does not contain a package.json file.