Skip to content

When using Composer to install, existing "package.js" is not updated, but on remove "package.js" is deleted. #411

Closed
@hcoat

Description

@hcoat

I have a recently upgraded Symfony 3 to 4 project in which I have been using yarn to manage my js dependencies.

I decided to try installing webpack-encore using the following commands:

 composer require symfony/webpack-encore-pack
 yarn install

I noticed my package.json was not altered and thought it might happen later, so I continued on.
I configured webpack.config.js and tried running

 yarn encore dev --watch

I got an error which I did not record at the time saying something to the effect that encore command could not be found.

I decided I wasn't ready to troubleshoot the problem and uninstalled with the following command:

 composer remove symfony/webpack-encore-pack

After which my pre-existing package.json had been removed.

I would expect the installation to give a warning or error if it cannot handle a pre-existing package.json.

Also I definitely do not think that it should be presumed that the package.json is there only because of webpack-encore and it should remain after webpack-encore has been removed.

Thanks

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