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

[BUG] Workspace symlinks go to wrong path if directory path starts with ~ #2447

Open
MonochromeChameleon opened this issue Jan 6, 2021 · 1 comment
Labels
Bug thing that needs fixing Priority 2 secondary priority issue Release 7.x work is associated with a specific npm 7 release

Comments

@MonochromeChameleon
Copy link

Current Behavior:

On my work computer the setup that is enforced upon me is for code to be placed inside a root-level directory called ~source-code - i.e.:

MYCOMPUTER:foo monochromechameleon$ pwd
/~source-code/projects/foo

If I create a workspace in that project, the generated symlink goes to e.g. ../~source-code/projects/foo/bar rather than simply to ../bar meaning that the dependency is not properly resolved.

I've confirmed that the symlinking works correctly when the ~ is not present, and also when it is not at the very start of the directory tree. I've not checked whether the problem arises for any other special characters.

Expected Behavior:

In the example above, I would expect the symlink to point to ../bar

Steps To Reproduce:

  1. create a root-level directory that starts with ~, e.g. /~something
  2. create a new npm package in that directory, using the workspaces feature
  3. run npm install

Environment:

  • OS: MacOS Mojave 10.14.6
  • Node: 14.15.0
  • npm: 7.3.0
@MonochromeChameleon MonochromeChameleon added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels Jan 6, 2021
@MonochromeChameleon
Copy link
Author

I've tracked down the source of the problem to npm-package-arg, PR here: npm/npm-package-arg#53

@ruyadorno ruyadorno removed the Needs Triage needs review for next steps label Jan 6, 2021
@ruyadorno ruyadorno removed their assignment Feb 26, 2021
@ruyadorno ruyadorno added the Priority 2 secondary priority issue label Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Priority 2 secondary priority issue Release 7.x work is associated with a specific npm 7 release
2 participants