Skip to content
This repository has been archived by the owner on Feb 7, 2020. It is now read-only.

error when i do awsmobile pull #123

Open
stevemao opened this issue May 4, 2018 · 25 comments
Open

error when i do awsmobile pull #123

stevemao opened this issue May 4, 2018 · 25 comments

Comments

@stevemao
Copy link

stevemao commented May 4, 2018

awsmobile project's access information copied to: src/aws-exports.js
contents in #current-backend-info/ is synchronized with the latest in the aws cloud
? sync corresponding contents in backend/ with #current-backend-info/ Yes
(node:82217) UnhandledPromiseRejectionWarning: Error: EEXIST: file already exists, symlink '../mime/cli.js' -> '/Users/stevemao/workdir/news/awsmobilejs/backend/cloud-api/Posts/node_modules/.bin/mime'

Any idea why?

@UnleashedMind
Copy link
Contributor

We are investigating this issue.
This happens at the last step of the pull, the cli is updating the backend (your development) contents with the latest. So the contents in the #current-backend-info is already sync'ed up with the cloud.

@UnleashedMind
Copy link
Contributor

What is your cli and node version?
I was not able to reproduce this error, with the same symlink in the node_modules/.bin folder.

@stevemao
Copy link
Author

stevemao commented May 4, 2018

$ node -v
v10.0.0

$ npm -v
6.0.0

I tried

$ node -v
v6.10.3

$ npm -v
6.0.0

It gave me the same result.

My system: macOS High Sierra 10.13.2

My dependencies in one of the cloud apis:

"dependencies": {
    "amazon-cognito-identity-js": "^1.16.0",
    "aws-sdk": "^2.49.0",
    "aws-serverless-express": "^3.2.0",
    "body-parser": "^1.17.1",
    "elasticsearch": "^14.2.2",
    "express": "^4.15.2",
    "http-aws-es": "^4.0.0"
  },
  "devDependencies": {},

@UnleashedMind
Copy link
Contributor

the cli only works for node version 7+, so node version 6.* is not a good choice.
Could you please try to use node version 8.9.0? That's the version that's been extensively tested. We haven't tested on node version 10.0.0 yet.

@stevemao
Copy link
Author

stevemao commented May 7, 2018 via email

@stevemao
Copy link
Author

stevemao commented May 8, 2018

I just tried it gives me the same result

$ npm version
{ 
  npm: '6.0.0',
  ares: '1.10.1-DEV',
  cldr: '32.0',
  http_parser: '2.7.0',
  icu: '60.1',
  modules: '57',
  nghttp2: '1.25.0',
  node: '8.10.0',
  openssl: '1.0.2n',
  tz: '2017c',
  unicode: '10.0',
  uv: '1.19.1',
  v8: '6.2.414.50',
  zlib: '1.2.11' }
retrieving the latest backend awsmobile project information
awsmobile project's details logged at:
    awsmobilejs/#current-backend-info/backend-details.json
awsmobile project's specifications logged at:
    awsmobilejs/#current-backend-info/mobile-hub-project.yml
awsmobile project's access information logged at:
    awsmobilejs/#current-backend-info/aws-exports.js
awsmobile project's access information copied to:
    src/aws-exports.js
contents in #current-backend-info/ is synchronized with the latest in the aws cloud
fs.js:1014
  return binding.symlink(preprocessSymlinkDestination(target, type, path),
                 ^

Error: EEXIST: file already exists, symlink '../mime/cli.js' -> '/Users/stevemao/workdir/news/awsmobilejs/backend/cloud-api/QueryPosts/node_modules/.bin/mime'
    at Object.fs.symlinkSync (fs.js:1014:18)
    at copySync (/Users/stevemao/.nvm/versions/node/v8.10.0/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:58:8)
    at contents.forEach.content (/Users/stevemao/.nvm/versions/node/v8.10.0/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)
    at copySync (/Users/stevemao/.nvm/versions/node/v8.10.0/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:51:14)
    at contents.forEach.content (/Users/stevemao/.nvm/versions/node/v8.10.0/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)
    at copySync (/Users/stevemao/.nvm/versions/node/v8.10.0/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:51:14)
    at contents.forEach.content (/Users/stevemao/.nvm/versions/node/v8.10.0/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)

@codeyogi911
Copy link

Hi i am also facing the same issue:

contents in #current-backend-info/ is synchronized with the latest in the aws cloud
fs.js:1014
  return binding.symlink(preprocessSymlinkDestination(target, type, path),
                 ^

Error: EEXIST: file already exists, symlink '../uuid/bin/uuid' -> '/Users/shashwatjain/Projects/Ionic/myApp/awsmobilejs/backend/cloud-api/imageplumber/node_modules/.bin/uuid'
    at Object.fs.symlinkSync (fs.js:1014:18)
    at copySync (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:58:8)
    at contents.forEach.content (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)
    at copySync (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:51:14)
    at contents.forEach.content (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)
    at copySync (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:51:14)
    at contents.forEach.content (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)

@stevekinney
Copy link

Do y'all have anything custom going on in your Cloud APIs?

@stevemao
Copy link
Author

@stevekinney no

@dylan-westbury
Copy link

dylan-westbury commented Jun 5, 2018

Me too, node LTS and new aws amplify project.

New to awsmobile... what could be wrong?


    src/aws-exports.js
contents in #current-backend-info/ is synchronized with the latest in the aws cloud
fs.js:1014
  return binding.symlink(preprocessSymlinkDestination(target, type, path),
                 ^

Error: EEXIST: file already exists, symlink '../mime/cli.js' -> '/xxxx/wesbite/awsmobilejs/backend/cloud-api/sampleLambda/node_modules/.bin/mime'
    at Object.fs.symlinkSync (fs.js:1014:18)
    at copySync (/Users/Dylan/.nvm/versions/node/v8.11.2/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:58:8)
    at contents.forEach.content (/Users/Dylan/.nvm/versions/node/v8.11.2/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)
    at copySync (/Users/Dylan/.nvm/versions/node/v8.11.2/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:51:14)
    at contents.forEach.content (/Users/Dylan/.nvm/versions/node/v8.11.2/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)
    at copySync (/Users/Dylan/.nvm/versions/node/v8.11.2/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:51:14)
    at contents.forEach.content (/Users/Dylan/.nvm/versions/node/v8.11.2/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)

website Dylan$ node -v
v8.11.2

@ianpogi5
Copy link

Here's mine:

contents in #current-backend-info/ is synchronized with the latest in the aws cloud
fs.js:1014
  return binding.symlink(preprocessSymlinkDestination(target, type, path),
                 ^

Error: EEXIST: file already exists, symlink '../../../../../../../semver/bin/semver' -> '/xxxx/awsmobilejs/backend/cloud-api/jobs/node_modules/.bin/semver'
    at Object.fs.symlinkSync (fs.js:1014:18)
    at copySync (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:58:8)
    at contents.forEach.content (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)
    at copySync (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:51:14)
    at contents.forEach.content (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)
    at copySync (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:51:14)
    at contents.forEach.content (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)

node v8.11.2
npm v5.6.0

@ianpogi5
Copy link

Here's what I did to recreate the problem.

  1. Create the App in the Mobile Hub AWS console.
  2. Enable Cloud logic.
  3. Create new API.
  4. On your project source code, awsmobile init projectid
  5. awsmobile pull
  6. cd awsmobile/backend/cloud-api/your-api-folder/
  7. Create package.json file
  8. npm install aws-sdk --save
  9. Go back to root folder of your project
  10. awmobile push

@jtnix
Copy link

jtnix commented Jun 29, 2018

Same for me, nothing super custom going on, but I did manually change the remote AWS node version to 8.10 for all API routes in the mobile-hub-project.yml file just before it started happening:

contents in #current-backend-info/ is synchronized with the latest in the aws cloud
fs.js:143
    throw err;
    ^

Error: EEXIST: file already exists, symlink '../uuid/bin/uuid' -> '/Users/xxx/react/xxx/awsmobilejs/backend/cloud-api/xxx/node_modules/.bin/uuid'
    at Object.fs.symlinkSync (fs.js:1000:3)
    at copySync (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:58:8)
    at contents.forEach.content (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)
    at copySync (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:51:14)
    at contents.forEach.content (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)
    at copySync (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:51:14)
    at contents.forEach.content (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)

When I remove the node_modules from the awsmobilejs/backend/cloud-api/xxx folder, and re-run awsmobile push I get a similar error, but from within a different 'package' this time:

Error: EEXIST: file already exists, symlink '../mime/cli.js' -> '/Users/xxx/react/xxx/awsmobilejs/backend/cloud-api/xxx/node_modules/.bin/mime'
    at Object.fs.symlinkSync (fs.js:1000:3)
    at copySync (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:58:8)
    at contents.forEach.content (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)
    at copySync (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:51:14)
    at contents.forEach.content (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)
    at copySync (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:51:14)
    at contents.forEach.content (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)

The deployed serverless code still works for me in any case, it's just a confusing error!

@realadeel
Copy link

Getting something similar when running "awsmobile push". Last thing I did was npm install a new library ("getstream"). Uninstalling it and re-pushing did not fix the error.

node v9.2.0
npm v5.5.1

=====
contents in #current-backend-info/ is synchronized with the latest in the aws cloud
fs.js:1034
return binding.symlink(preprocessSymlinkDestination(target, type, path),
^

Error: EEXIST: file already exists, symlink '../sshpk/bin/sshpk-conv' -> '/Users/xxx/projects/xxx/awsmobilejs/backend/cloud-api/API/node_modules/.bin/sshpk-conv'
at Object.fs.symlinkSync (fs.js:1034:18)
at copySync (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:58:8)
at contents.forEach.content (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
at Array.forEach ()
at copySync (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:51:14)
at contents.forEach.content (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
at Array.forEach ()
at copySync (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:51:14)
at contents.forEach.content (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
at Array.forEach ()

@realadeel
Copy link

This worked for me:
remove node_modules
npm install --no-bin-links

Inspiration: TritonDataCenter/node-sshpk#16

@stevemao
Copy link
Author

stevemao commented Jul 5, 2018

This worked for me:
remove node_modules
npm install --no-bin-links

Yup, I googled it and saw that too... Seems like a workaround, not a fix.

@jbarwick
Copy link

jbarwick commented Jul 5, 2018 via email

@stevemao
Copy link
Author

stevemao commented Sep 5, 2018

I want to emphasize that this issue is really critical... awsmobile publish is completely broken.

@barrypeterson
Copy link

Same issue: -- Lmk how I can help!

awsmobile project's access information copied to:
    app/aws-exports.js
contents in #current-backend-info/ is synchronized with the latest in the aws cloud
fs.js:1014
  return binding.symlink(preprocessSymlinkDestination(target, type, path),
                 ^

Error: EEXIST: file already exists, symlink '../mime/cli.js' -> '/Users/bpeterson/Projects/notify/awsmobilejs/backend/cloud-api/messages/node_modules/.bin/mime'
    at Object.fs.symlinkSync (fs.js:1014:18)
    at copySync (/Users/bpeterson/.nvm/versions/node/v8.11.3/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:58:8)
    at contents.forEach.content (/Users/bpeterson/.nvm/versions/node/v8.11.3/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)
    at copySync (/Users/bpeterson/.nvm/versions/node/v8.11.3/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:51:14)
    at contents.forEach.content (/Users/bpeterson/.nvm/versions/node/v8.11.3/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)
    at copySync (/Users/bpeterson/.nvm/versions/node/v8.11.3/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:51:14)
    at contents.forEach.content (/Users/bpeterson/.nvm/versions/node/v8.11.3/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)

@nishanthk
Copy link

Is there a fix for this, having same issue

@idevelop
Copy link

Still an issue in 2019 :)

@nawwa
Copy link

nawwa commented Feb 12, 2019

Yes still an issue .. awsmobile push give
Error: EEXIST: file already exists, symlink '../json2csv/bin/json2csv.js' ->

:(

@automatication
Copy link

automatication commented Feb 12, 2019

Removed node_modules and did:
npm install --no-bin-links

Seems to work for me.

@nawwa
Copy link

nawwa commented Apr 25, 2019

@automatication same, worked today :)

@shivaramani
Copy link

Still getting the error. Any other workarounds?
Not working with removing nodemodules and npm install --no-bin-links

Error: EEXIST: file already exists, symlink '../uuid/bin/uuid' -> '//node_modules/aws-sdk/node_modules/.bin/uuid'

at /node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests