[Vuejs]-Laravel 5 : Install custom component using Vue having error " is not in the npm registry."

0👍

With require() you can import NPM packages by their name, like require('express');

If you want to import a local file, you have to use a relative path, which for “current path” is ./

So your code should be:

Vue.component('main-chart-of-accounts', require('./chart_of_account.vue').default);

That way your bundler understands that you want a file, and not a package named “chart_of_account.vue”

Leave a comment