How to use npm package in Laravel 5.4

Posted 1 year ago by fahad

I am trying to use https://www.npmjs.com/package/js-datepicker package in my Laravel 5.4 project. so far what i have done:

at bootstrap.js


at app.js

// after vue instance

const picker = datepicker('.schedule_date');

it shows me the following error: in console

Uncaught ReferenceError: datepicker is not defined
    at HTMLDocument.<anonymous> (orders:847)
    at mightThrow (app.js:7700)
    at process (app.js:7768)
(anonymous) @ orders:847
mightThrow @ app.js:7700
process @ app.js:7768

Any help is highly appreciated. Thanks

Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up


Reply to

Use Markdown with GitHub-flavored code blocks.