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 <node-package-manager>.cmd --no-bin-links --production #13120

Closed
2 tasks done
Lekha30 opened this issue Aug 16, 2023 · 10 comments
Closed
2 tasks done
Labels
bug Something isn't working functions Issues tied to the functions category p1 platform-push Issues related to `amplify push`

Comments

@Lekha30
Copy link

Lekha30 commented Aug 16, 2023

How did you install the Amplify CLI?

curl

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

19.6.0

Amplify CLI Version

12.2.5

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 changes made to the cloud resources managed by Amplify .

Describe the bug

amplify init stopped working all of a sudden.
I have various envrionments set up in amplify and has been working fine. All of a sudden amplify init stopped working. I am not able to do init. It is complaining of errors in the lambda layer.
image

Expected behavior

It should be updated to the env pointed out. amplify pull or amplify push not working either.

Reproduction steps

Checkout to a new amplify env
do amplify init

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.
@Lekha30 Lekha30 added the pending-triage Issue is pending triage label Aug 16, 2023
@Lekha30
Copy link
Author

Lekha30 commented Aug 16, 2023

I was able to progress further by cleaning up all the node modules and temp folders. Amplify init works but amplify push is not working yet. Had some one faced this issue before?
image

@ykethan
Copy link
Member

ykethan commented Aug 16, 2023

Hey @Lekha30, thank you for reaching out. The appears to be similar to #13043.
Could you try removing the .cmd in the amplify.state file in backend/function/<function-name> and retry pushing the project.

@ykethan ykethan added functions Issues tied to the functions category pending-response Issue is pending response from the issue author platform-push Issues related to `amplify push` labels Aug 16, 2023
@Lekha30
Copy link
Author

Lekha30 commented Aug 17, 2023

Awesome, that worked. Appreciate the timely help. Do you know why that got in the first place itself?

@github-actions github-actions bot removed the pending-response Issue is pending response from the issue author label Aug 17, 2023
@ykethan
Copy link
Member

ykethan commented Aug 17, 2023

Hey @Lekha30, was the function in the project created in a windows environment?
Looking at the code line it appears the npm.cmd gets added in a windows environment.

@ykethan ykethan added the pending-response Issue is pending response from the issue author label Aug 17, 2023
@ykethan
Copy link
Member

ykethan commented Aug 17, 2023

marking this as bug for further improvements.

@ykethan ykethan added bug Something isn't working p1 and removed pending-response Issue is pending response from the issue author pending-triage Issue is pending triage labels Aug 17, 2023
@josefaidt josefaidt changed the title amplify init stopped working amplify console build fail with <node-package-manager>.cmd --no-bin-links --production Aug 17, 2023
@ykethan
Copy link
Member

ykethan commented Sep 5, 2023

Summary: A fix for functions with yarn package manager in windows was merged on #13047
Fix to address npm, pnpm package manager in windows: #13133

The PR: #13047 seems to also include a change on line to fix: #13001
the issue will need to be re-tested and closed if the behavior has been mitigated.

@qwikag
Copy link

qwikag commented Sep 23, 2023

For me this I had an extra function which I had not started using I had only created it: it had this amplify.state file:

{
  "pluginId": "amplify-nodejs-function-runtime-provider",
  "functionRuntime": "nodejs",
  "useLegacyBuild": true,
  "defaultEditorFile": "src\\index.js",
  "scripts": {
    "build": "npm.cmd install --no-bin-links --production"
  }
}

Whereas other functions had this:

{
  "pluginId": "amplify-nodejs-function-runtime-provider",
  "functionRuntime": "nodejs",
  "useLegacyBuild": true,
  "defaultEditorFile": "src/index.js"
}

the other 2 working functions are triggers built from Post Confirm and Post Auth during >amplify add auth , but the failing one was just an >amplify add function, and was not in use, I used >amplify remove function, and the error was gone.
So there is something wrong with the amplify add function???

@qwikag
Copy link

qwikag commented Sep 23, 2023

@ykethan,
not sure if my above comment helps.
but these functions I built were only in the last week.
custom failed Auth triggered were ok.

@josefaidt
Copy link
Contributor

Closing as this issue is now resolved with the release of CLI 12.6.0

@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 p1 platform-push Issues related to `amplify push`
Projects
None yet
Development

No branches or pull requests

4 participants