Skip to content

[Frontend] The docs for Encore setup simply do not work and error due to package.json not being populated #17578

Closed
@vekien

Description

@vekien

Hello,

The documentation says to install Encore then run npm run watch, however this does not work because no scripts get added to package.json.

Steps to reproduce.

  1. https://symfony.com/doc/current/frontend/encore/installation.html
    Installing Encore in non Symfony Applications
    npm install @symfony/webpack-encore --save-dev

  2. https://symfony.com/doc/current/frontend/encore/simple-example.html
    npm run watch

Error:

λ npm run watch
npm ERR! Missing script: "watch"
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR!   npm run

Package.json:

{
  "dependencies": {
    "@symfony/webpack-encore": "^4.2.0"
  }
}

Doesn't matter if you use NPM or Yarn, or whatever command you use.

Unless I am missing something this is supposed to work as it's step 1 to 2 of the documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions