Skip to content

amplify always chooses the wrong package manager #13931

@thegrandpoobah

Description

@thegrandpoobah

How did you install the Amplify CLI?

npm

If applicable, what version of Node.js are you using?

16.20.2

Amplify CLI Version

12.12.6

What operating system are you using?

Linux (and Windows WSL)

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

No

Describe the bug

amplify push (or pull) always chooses yarn for me (and pnpm for a developer on my team) even though the package manager we've been using is npm and there is a package-lock.json file in the repo.

We've been away from this project for a couple months and we haven't made ANY changes to the repo/project/amplify and this behaviour just started when we upgraded our amplify. Not sure which version we were running prior.

Expected behavior

Use npm as was being done before.

Reproduction steps

just type amplify pull or amplify push on our project that has a package-lock.json in the root
Please note: there is not a yarn.lock file anywhere to be seen in this amplify project folder structure. I have made tripley sure of this.

Project Identifier

f692ebb27a73e75af29c87f79f8db1e0

Log output

Fetching updates to backend environment: dev from the cloud.⠋ Building resource api/AdminQuerie⠼ Building resource api/lambdaserverlessadmi⚠️ WARNING: owners may reassign ownership for the following model(s) and role(s): Profile: [owners], Customer: [owners]. If this is not intentional, you may want to apply field-level authorization rules to these fields. To read more: https://docs.amplify.aws/cli/graphql/authorization-rules/#per-user--owner-based-data-access.
⠦ Building resource api/lambdaserverlessadmi✅ GraphQL schema compiled successfully.

Edit your schema at /amplify/backend/api/lambdaserverlessadmi/schema.graphql or place .graphql files in a directory at /amplify/backend/api/lambdaserverlessadmi/schema
✖ Fetching updates to backend environment: dev from the cloud.
✖ There was an error initializing your environment.
🛑 Packaging overrides failed.
Command failed with exit code 1: yarn install
warning package.json: No license field
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
... and lots more yarn failures

Additional information

I fixed this by deleting yarn from my computer. My colleague fixed it by renaming her pnpm binary.

Before submitting, please confirm:

  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingoverrideIssues related to resource override CDK functionality

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions