Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

amplify console build fail with yarn.cmd --no-bin-links --production #13043

Closed
2 tasks done
ykethan opened this issue Aug 1, 2023 · 4 comments
Closed
2 tasks done

amplify console build fail with yarn.cmd --no-bin-links --production #13043

ykethan opened this issue Aug 1, 2023 · 4 comments
Labels
bug Something isn't working functions Issues tied to the functions category hosting Issues tied to hosting category p1 windows Issues tied to running the CLI on Windows

Comments

@ykethan
Copy link
Contributor

ykethan commented Aug 1, 2023

How did you install the Amplify CLI?

No response

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

No response

Amplify CLI Version

12.2.3

What operating system are you using?

Windows

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

none

Describe the bug

reported: #10815 (comment)

When utilizing windows environment and creating a new function with yarn or npm as package manager causes build
failures

2023-08-01T16:11:16.331Z [WARNING]: - Initializing your environment: dev
2023-08-01T16:11:16.895Z [WARNING]: ✔ Initialized provider successfully.
2023-08-01T16:11:17.473Z [WARNING]: ✖ There was an error initializing your environment.
2023-08-01T16:11:17.473Z [INFO]: 🛑 Received error [Error: Command failed with ENOENT: yarn.cmd --no-bin-links --production
                                 spawn yarn.cmd ENOENT] running command [yarn.cmd --no-bin-links --production]
2023-08-01T16:11:17.473Z [INFO]: Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/
2023-08-01T16:11:17.482Z [INFO]: Session Identifier: 19f5657e-9905-4443-b23d-ee3beec6315a
2023-08-01T16:11:17.506Z [ERROR]: !!! Build failed
2023-08-01T16:11:17.506Z [ERROR]: !!! Non-Zero Exit Code detected

Workaround:

Remove the .cmd in the amplify.state file in backend/function/<function-name>.
Then commit changes.
the build should proceed without errors

Expected behavior

build functions in console without errors

Reproduction steps

  1. create a new function in windows env or we can also add .cmd in mac env for test
  2. commit to git
  3. connect to hosting frontend
  4. check backend build for failure

Project Identifier

No response

Log output

# Put your logs below this line


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.
@ykethan ykethan added pending-triage Issue is pending triage functions Issues tied to the functions category bug Something isn't working hosting Issues tied to hosting category windows Issues tied to running the CLI on Windows and removed pending-triage Issue is pending triage labels Aug 1, 2023
@josefaidt josefaidt added the p1 label Aug 1, 2023
@calavera
Copy link

calavera commented Aug 1, 2023

You probably don't need to add the .cmd extension to run those commands on Windows. See how yarn works on Windows Powershell and Windows CMD without it:

image

image

@0618
Copy link
Contributor

0618 commented Aug 1, 2023

The error looks similar as #13001

@josefaidt
Copy link
Contributor

Closed as resolved with the release of 12.3.0 (#13047)

@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working functions Issues tied to the functions category hosting Issues tied to hosting category p1 windows Issues tied to running the CLI on Windows
Projects
None yet
Development

No branches or pull requests

4 participants