Bootstrap не может найти пакет symfony/ стимулаPhp

Кемеровские программисты php общаются здесь
Ответить
Гость
 Bootstrap не может найти пакет symfony/ стимула

Сообщение Гость »

Контекст
Я изучаю Symfony по курсу «Обучение ENI» «Научитесь разрабатывать веб-приложения с помощью PHP и Symfony (2-е издание)», автор: Ив РОКАМОРА.
В разделе «Webpack Encore» он объясняет, как использовать Sass и Vue.js для предварительной обработки CSS и Javascript.
Однако Я не могу заставить Webpack-Encore работать вместе с Bootstrap.
Проблема When I run

Код: Выделить всё

npm run watch
, I am confronted by the following error:[/b]

Код: Выделить всё

 ERROR  Failed to compile with 1 errors                                  9:54:06

Module build failed: Module not found:
"./assets/bootstrap.js" contains a reference to the file "@symfony/stimulus-bundle".
This file can not be found, please check it for typos or update it if the file got moved.
What am I expecting

Код: Выделить всё

npm run watch
should correctly build the application.
What I tried
First of all, I tried using composer to install the missing package, but it appears that stimulus-bundle is part of Webpack-Encore, and it already is on my project.
I noticed that the guide had a different

Код: Выделить всё

package.json
: mine was missing

Код: Выделить всё

@hotwired/stimulus
and

Код: Выделить всё

@symfony/stimulus-bridge
, so I tried to install them with composer, but those package cannot be installed this way. I even tried to add them manually (it is a bad habit, right?), and then run a

Код: Выделить всё

npm install
, but

Код: Выделить всё

npm run watch
still fails with the same error statement.
After cleaning my project and then punctiliously following each and every step of the guide, I still get the same error.
Edit
The problem encountered was that I was using Symfony 7.0.1, while this method works for Symfony 6.


Источник: https://stackoverflow.com/questions/776 ... lus-bundle
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Php»