-
Notifications
You must be signed in to change notification settings - Fork 822
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 Push/mock with added function fails: "Packaging lambda function failed with the error Command failed with exit code 243: npm install --production" #8653
Comments
OP:
I am not sure that this is relevant, though, as I notice amplify intelligently detecting npm usage (after I manually run |
Running into this same issue with yarn, but I never used yarn... |
|
@codybreene what is your os/npm/amplify/yarn versions? what do you get if you cd into amplify/backend/api/function/functionname/src, delete a yarn.lock file if it exists, run npm install (thus creating a package-lock.json) file, cd back to the project tld and re-run amplify push/amplify mock function? |
I found that I had installed `yarn` in an old Ruby environment, and for
some reason that was being called. Still confused, though, because I was
never using yarn within this project. Only npm.
…On Thu, Nov 4, 2021 at 9:34 PM Eric Anderson ***@***.***> wrote:
@codybreene <https://github.com/codybreene> what is your
os/npm/amplify/yarn versions?
what do you get if you cd into
amplify/backend/api/function/functionname/src, delete a yarn.lock file if
it exists, run npm install (thus creating a package-lock.json) file, cd
back to the project tld and re-run amplify push/amplify mock function?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8653 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABLVA5SJDUUTNUJVDH74RO3UKNNDZANCNFSM5HJYS5EQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
I'm still struggling with this problem, may try to dig into source code later this week. Are there any amplify experts out there who could recommend good diagnostic steps? |
Hey @eettaa 👋 thanks for raising this! Was the Amplify CLI installed with npm using
|
Hi @josefaidt , thanks so much for your reply. I'm still very interested in diagnosing this and will help any way I can.
Do you have recommendations for other diagnostic steps we could take? I have yet to dig through the cli source code but am wondering if I can identify the failing line there/if it would offer anything of value. |
Thank you for clarifying @eettaa and providing those details! Do you still experience this issue when the CLI is installed without For what it's worth there is also an open feature request to support a "Bring your own Node package manager" #6382, and also there are command hooks that we could potentially use to bootstrap function dependencies. |
Hi @josefaidt , thanks for your response.
... among other errors.
indicating anyone can run and the pointed-to executable is
Which seems to have the necessary read/execute permissions regardless of user? When running Thank you for your help |
Hey @eettaa please see this npm docs page for resolving the issue with installing packages globally. From here we can check a few things:
|
RESOLVED For Posterity:Before installing nvm, it's important to note the versions of the relevant software, as you will need to reinstall them (first via
Amplify Directory PermissionsIt appears that the
and here are the permissions of the src/ dir:
where is my user/group as expected. It appears the owner always has write access, so it looks okay to me? |
Ah awesome @eettaa I'm glad to hear you're back up and running! Installing Node and npm packages with sudo can cause some headaches I've found, but those permissions look correct! Closing issue as the issue has been resolved 🙂 |
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs. Looking for a help forum? We recommend joining the Amplify Community Discord server |
Before opening, please confirm:
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
v14.18.1
Amplify CLI Version
6.3.1
What operating system are you using?
Ubuntu 18.04.5 LTS
Amplify Categories
function, api
Amplify Commands
push
Describe the bug
When I run
amplify push
oramplify mock function
from my projects TLD (i.e. the dir that contains amplify/)I get the seemingly related errors:Push:
Mock:
This happens for a clean project where I add a new amplify backend to an (amplify-hosted) frontend using default backend options:
The api schema does not connect to the lambda function, fwiw.
If I cd into amplify/backend/function/<function_name>/src and run
npm install [--production]
the command succeeds.Upon rerunning push/mock I get similar npm-flavored errors:
Push:
Mock:
I am on Ubuntu v14.18.1 / yarn 1.22.15 / npm 6.14.15 / amplify 6.3.1
I have verified that this works as expected on macOS big sur 11.2.3 / yarn 1.22.11 / npm 7.18.1 / amplify 6.3.1
I have found related #7883 but believe it is irrelevant as I am still on yarn 1.x
I have found related #5483 but believe it is irrelevant as it is related to older amplify cli versions and has since been corrected.
Thank you for your help!!!
Expected behavior
Push pushes changes (including newly added lambda) to the cloud
Mock spins up local instances of the backend.
Reproduction steps
Using my OS/cli versions:
amplify pull --appId --envName staging // Pull an amplify project that has no backend configured
amplify add api // choose fully default settings
amplify add function // choose fully default settings, hello world template
amplify push
GraphQL schema(s)
Log output
Additional information
No response
The text was updated successfully, but these errors were encountered: