Open neuquen opened 1 year ago
Hey @neuquen, thank you for reaching out. I was able to reproduce the issue. marking as bug.
Reproduction steps:
amplify init
amplify override project
yarn.lock
file was created by default, removed the yarn.lock
file and the node_modules
folder.npm install
and amplify push -> no errorsamplify pull
this removed the node_modules and package-lock.json
.
Due to this the Cannot find module '@aws-amplify/cli-extensibility-helper' or its corresponding type declarations.
occurs in the override file. Thanks @ykethan!
In my case the yarn.lock file was created by default
I didn't see this behavior when running the override project command. Any reason why the yarn.lock
file was not generated for me? Also, if you don't remove the yarn.lock
file, do you find that an amplify pull
deletes that file as well?
@neuquen I did observe a similar behavior with yarn.lock
file as well.
Amplify CLI currently does not support utilizing yarn 3 which is causing the error message on overrides, the feature request is currently being tracked on https://github.com/aws-amplify/amplify-cli/issues/13178
Could you try utilizing an older version of yarn for example 1.22.19 and ensure the $PATH
environment variable has been configured?
For example, we can run which yarn
on the terminal for MacOS to confirm if the yarn has been configured on the variable.
Information on setting up the path
Thanks for the response @ykethan.
We were able to find a temporary workaround for our situation. Whenever we pull, we temporarily add a /amplify/.yarnrc.yml
file (with an empty yarnPath: ""
included) and then remove it once the pull is done.
We'll use that in the meantime because we'd rather wait until yarn 3 is supported.
Amplify CLI Version
12.5.1
Question
I recently needed to override some project-level config and followed this documentation in order to do so.
Running
amplify override project
generated aamplify/backend/package.json
file in order to include dependencies needed to execute the generatedamplify/backend/awscloudformation/overrides.js
file. Our app uses yarn (v3) to manage its own dependencies, but we decided to manage amplify dependencies separately using NPM. So, withinamplify/backend
I rannpm install
in order to include the needed dependencies which generatedamplify/backend/package-lock.json
and pushed it all up withamplify push
. No issues there.However, when I pull using
amplify pull
, it removes theamplify/backend/package-lock.json
file and it throws this error:If I try to pull using option 3 (creating an empty yarn.lock file), both the npm lock file AND the yarn lock file are removed and I see the same error. So I'm hoping you can answer the following questions:
amplify/backend/package-lock.json
and emptyamplify/backend/yarn.lock
files being removed when I pull?yarn.lock
file as yarn suggests or is there some other recommended approach?