If you run into the following error there are two steps we can take to mitigate this error that do not involve modifying/replacing the #current-cloud-backend.zip
archive in your deployment bucket.
🛑 An error occurred during the push operation: /
EEXIST: file already exists, symlink '../ulid/bin/cli.js' -> '/myproject/amplify/.temp/#current-cloud-backend/function/somelayer/lib/nodejs/node_modules/.bin/ulid'
In your file explorer perform the following:
- delete the
node_modules
folder of the affected layer (using the example above,rm -rf amplify/#current-cloud-backend/function/somelayer/lib/nodejs/node_modules
) - remove the
.temp
directory,rm -rf amplify/.temp
Once this is complete amplify push
will successfully progress
For anyone that runs into this issue but the above does not solve the problem. Using this in combination with this solution [amplify-graphql-syntax-workaround as per Josef's recommendation solved the problem for me. To make it clear, here are the steps I followed :
amplify-[YOUR_PROJECT]-[YOUR_ENV]-[SOME #}-deployment
)#current-cloud-backend.zip
file.unzip #current-cloud-backend.zip -d amplify/#current-cloud-backend
#current-cloud-backend
folder withrm -rf amplify/#current-cloud-backend/function/[YOUR_LAMBDA_LAYER_NAME]/lib/nodejs/node_modules
rm -rf amplify/.temp
cd amplify/#current-cloud-backend/
zip -r "../#current-cloud-backend.zip" *
cd ..
#current-cloud-backend.zip
file to the S3 bucket (click the orange Upload button). This will overwrite the existing .zip file that is already there (the one your downloaded before).cd ..
You should now be back in the root folder of your project (where the amplify folder exists).amplify push --force