webpack-encore: error Command "encore" not found.
Hello, I have installed Encore in Symfony3.3 on linux-VM.
composer require encore
yarn install
when I run yarn run encore dev
I got error Command "encore" not found.
I have checked node_modules/.bin/
and it contains only uuid.
Do you have any suggestion?
regards,
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 20 (3 by maintainers)
@engharb You’re still using the same outdated version of Yarn there:
Yarn v0.21.3 was released almost a year ago, the current stable version is the 1.3.2.
Try the following:
node_modules
directory and theyarn.lock
file if you have oneyarn add --dev @symfony/webpack-encore
againHi everyone I have the same problem and I want to share with you my solution First, I change my package. Json to this
{ “devDependencies”: { “@symfony/webpack-encore/”: “^0.22.0”, “webpack-notifier”: “^1.6.0” }, “license”: “UNLICENSED”, “private”: true, “scripts”: { “dev-server”: “encore dev-server”, “dev”: “./node_modules/@symfony/webpack-encore/bin/encore.js dev”, “watch”: “./node_modules/@symfony/webpack-encore/bin/encore.js dev --watch”, “build”: “./node_modules/@symfony/webpack-encore/bin/encore.js production --progress” } }
and I run rhis command: yarn run dev
I already have a packge.json file before in my symfony project, I used Gulp to pre-compile my assets, Now I following the encore tutorial in documentation, but not works, So, I check the recipes in symfony, and add following to package.json:
and reinstall
yarn add --dev @symfony/webpack-encore
, then everything works!I think the documentation show be notice users that them are already have a
package.json
filethank you a lot, I followed the instructions from @Lyrkan and it was succeeded.
regards,