amplify-cli: Error Node when i use amplify push

How did you install the Amplify CLI?

yarn

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

16.15.0

Amplify CLI Version

12.0.0

What operating system are you using?

Mac

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

No

Describe the bug

i add a new dependencies in a function (amplify add function) who need to have nodejs 16.15 min i add this with yarn add.

But when i try to run amplify push i have this error:

Command failed with exit code 1: yarn --no-bin-links --production warning …/…/…/package.json: No license field error phenix-edge-auth@1.2.7: The engine “node” is incompatible with this module. Expected version “>=16.15.0”. Got “14.15.4” error Found incompatible module. yarn install v1.22.10 [1/4] Resolving packages… [2/4] Fetching packages… info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

But in my project i have no nodeJs 14.15.4 and no in my compute too. I tried some solutions with no result. I have no idea where is the problem of node.

amplify stock a node somewhere ?

Expected behavior

Just amplify need to use a correct version of node (node of my project)

Reproduction steps

yarn add package to a lambda function amplify push

Project Identifier

No response

Log output


Additional information

No response

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.

About this issue

  • Original URL
  • State: closed
  • Created 10 months ago
  • Comments: 15 (5 by maintainers)

Most upvoted comments

i uninstall amplify and add amplify directly with yarn (i don’t remove yarn). And now it work !!

May be my file amplify was blocked on a file node14, strange.

Thx for your time and your help 😃

the following will ensure Amplify CLI is removed

amplify uninstall
yarn global remove @aws-amplify/cli
# optionally remove leftover logs, metadata
rm -rf ~/.amplify

I would also suggest using corepack (which comes with later versions of Node.js) to install yarn rather than the homebrew installation. The homebrew yarn installation will use the current node.js runtime installed by volta, but maintain a separate set of global dependencies

You can get started with yarn via corepack with corepack enable and corepack prepare yarn@latest --activate