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

Support cross-drive linking for amplify-dev on windows #6950

Closed
4 tasks done
PawanKolhe opened this issue Mar 23, 2021 · 2 comments · Fixed by #6951
Closed
4 tasks done

Support cross-drive linking for amplify-dev on windows #6950

PawanKolhe opened this issue Mar 23, 2021 · 2 comments · Fixed by #6951
Labels
feature-request Request a new feature platform Issues tied to the general CLI platform

Comments

@PawanKolhe
Copy link
Contributor

Before opening, please confirm:

  • I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
  • I have searched for duplicate or closed issues.
  • I have read the guide for submitting bug reports.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

How did you install the Amplify CLI?

yarn

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

15.12.0

Amplify CLI Version

4.46.0

What operating system are you using?

Windows

Amplify Categories

Not applicable

Amplify Commands

Not applicable

Describe the bug

When setting up the dev environment on Windows, during setup-dev-win script, specifically when it runs the link-win script, if your Yarn installation is in a separate drive than the amplify-cli project, it will create an incorrect link for the amplify-dev command.

In my case, my Yarn directory is C:\Users\Pawan\AppData\Local\Yarn\bin\ and the amplify-cli project is at somewhere in the D drive: D:\...\amplify-cli\packages\amplify-cli\bin\amplify

This issue seems to be caused by this issue in the npm/cmd-shim package which amplify-cli/scripts/link-bin.js is using for setting up the linking for amplify-dev command on Windows.

Expected behavior

amplify-dev should correctly run.

Reproduction steps

  1. Place amplify-cli project in a different drive
  2. Run yarn run setup-dev-win from the amplify-cli project root
  3. Run amplify-dev in a sample project

GraphQL schema(s)

No response

Log output

No response

Screenshot
unknown

@kaustavghosh06
Copy link
Contributor

@PawanKolhe Thanks for submitting a fix for this!

@kaustavghosh06 kaustavghosh06 added platform Issues tied to the general CLI platform enhancement labels Mar 23, 2021
yuth pushed a commit that referenced this issue Mar 25, 2021
Description of changes

Using the pnpm/cmd-shim library instead of npm/cmd-shim would fix the cross-drive linking issue for amplify-dev on Windows. A PR on pnpm/cmd-shim fixed the issue whereas it's still not fixed on npm/cmd-shim.

This PR adds the pnpm/cmd-shim library and updates the imports in scripts/link-bin.js
Issue #, if available

fixes #6950
Description of how you validated changes

I checked the file at C:\Users\Pawan\AppData\Local\Yarn\bin\amplify-dev.ps1 for proper linking and verified that the amplify-dev command is properly running in sample projects.
@github-actions
Copy link

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 *-help channels for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 24, 2021
@josefaidt josefaidt added feature-request Request a new feature and removed enhancement labels Sep 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request a new feature platform Issues tied to the general CLI platform
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants