A
A
abuamr2019-08-28 14:01:17
JavaScript
abuamr, 2019-08-28 14:01:17

How to import node_modules in Laravel?

When importing from dependencies (package.json) of the "startbootstrap-sb-admin-2" package, it gives an error.

The code
window.Popper = require('popper.js').default;
window.$ = window.jQuery = require('jquery');

require('bootstrap');
require('startbootstrap-sb-admin-2');
...

Mistake
5d665e926bbc4302904010.png

The question is how to properly import packages from node_modules to laravel ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Aksentiev, 2019-08-28
@Sanasol

require('startbootstrap-sb-admin-2');

What are you trying to do with this? How is this supposed to work, even in theory?
There is a whole template with a bunch of html files and its own assembler, in fact, just a html / css / js site.
Those. you are trying to make require('папка-с-каким-то-сайтом');JS scripts into your assembly, and what should happen, the admin panel will appear automatically instead of your site?
To begin using this template, choose one of the following options to get started:
Download the latest release on Start Bootstrap
Install via npm: npm i startbootstrap-sb-admin-2
Clone the repo: git clone https://github.com/ BlackrockDigital/startbootstrap...
Fork, Clone, or Download on GitHub
There are as many as 4 installation options, you have chosen the most crutch and do not know what to do with it. Try another.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question