npmlaravel-mixjquery-tags-input

Cannot find module 'jquery.tagsinput-revisited


I've installed jquery.tagsinput-revisited via npm, which was provided here

npm i jquery.tagsinput-revisited

Then, I've added

require('jquery.tagsinput-revisited');

in one of my js file and

@import '~jquery.tagsinput-revisited/src/jquery.tagsinput-revisited';

in one of SCSS file.

Now, I'm having these error while npm run watch

This dependency was not found:

  • jquery.tagsinput-revisited in ./resources/js/bundle1.js

To install it, you can run: npm install --save jquery.tagsinput-revisited

ERROR in ./resources/js/bundle1.js Module not found: Error: Can't resolve 'jquery.tagsinput-revisited' in 'C:\xampp\htdocs\vetforum\www\resources\js' @ ./resources/js/bundle1.js 9:0-37 @ multi ./resources/js/bundle1.js

SCSS file get successfully compiled,but there seems an error in the js file.


Solution

  • After several attempts, i've done like this

    In JS file

    require('../vendors/tagsinput/jquery.tagsinput-revisited');
    

    In SCSS file

    @import '../vendors/tagsinput/jquery.tagsinput-revisited';