I am currently stuck at the Encore/Webpack installation. I followed the steps at symfony.com. But when continuing to the simple example I got stuck at running
yarn encore dev. I get the error: “Command “encore” not found”. I also have an error when running
symfony server:start after installing Encore and navigating to a view:
An exception has been thrown during the rendering of a template ("Could not find the entrypoints file from Webpack: the file "path/entrypoints.json" does not exist.").
As far as I know the entrypoints.json should have been autogenerated. I have Yarn 1.22.10 and NodeJS 6.14.12.
What I have done
I executed the commands
composer require symfony/webpack-encore-bundle
- I looked at StackOveflow questions ‘error Command “encore” not found.’ when running ‘yarn run encore’ in Symfony4, webpack encore dev-server not found /, Error Command “encore” not found. (separate backend webpack), Can’t run encore dev
- I executed the command
composer require webpack
- I noticed my package.json doesn’t have a scripts object where the command
encore dev is supposed to be living. I watched a YouTube video and followed it (https://youtu.be/Fs_4FMoSO90). That’s why I know this. I wonder why I don’t have it. Below is the package.json from the video. My package.json only has the dev dependency Bootstrap.
Package.json from video:
I removed the package.json, package-lock.json and executed
yarn install again and it installed some packages. I didn’t need NPM. I already got Bootstrap from my Yarn.lock (that’s the only thing in there). I still have both errors though.