I have recently developed a Vue.js 2 project using webpack which consists of 2 components. My goal is to share this project as an npm package so that the components can be easily reused in multiple projects.
After publishing the project on npm with npm publish
and installing the package using npm install my-components
, I noticed that the project was added to the node_modules
directory along with the entire source code, making it look like a copied version of the project.
Furthermore, when attempting to run the command npm build dist
, I encountered the following error:
npm ERR! Darwin 16.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "dist"
npm ERR! node v6.9.2
npm ERR! npm v3.10.9
npm ERR! missing script: dist
npm ERR! If you need help, you may report this error at: https://github.com/npm/npm/issues
npm ERR! Please include the following file with any support request: npm ERR!
/Users/myuser/Documents/Projects/my-components/npm-debug.log
In my project repository (https://github.com/Trelllis/my-components), there is a component named vue-version that I am unable to utilize, and the project my-components seems unresolved.
Could anyone provide guidance on how to properly publish this project with all its components included?
Thank you.