B
B
body92019-05-21 11:43:01
npm
body9, 2019-05-21 11:43:01

How to properly install modules via npm install in laravel?

Help me to understand. I need a plugin for jquery - maskedinput .
I do through the terminal:
npm install jquery.maskedinput --save
Installation is successful. Everything is in node_modules.
Next, I edit the bootstrap.js file - add

window.jquery.maskedinput = require('jquery.maskedinput');

The build is successful. But in the console displays - $(...).mask is not a function
Why so? What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dk-web, 2019-05-21
@dk-web

I messed up with jquery ui in due time.
in app.js
require('../../node_modules/jqueryui/jquery-ui.min.js');
in bootstrap.js
window.$ = window.jQuery = require('jquery');
window.$ = $.extend(require('jquery-ui'));
try with your plugin

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question