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

bin symlink goes to .yalc instead of node_modules copy #156

Open
jasonkuhrt opened this issue Feb 25, 2021 · 9 comments
Open

bin symlink goes to .yalc instead of node_modules copy #156

jasonkuhrt opened this issue Feb 25, 2021 · 9 comments

Comments

@jasonkuhrt
Copy link

I'm working on a package that has a generated aspect.

It has a CLI to run the generation.

When generation runs, the package expects to find itself within node_modules.

The problem is that the node_modules/.bin file symlinks (it seems) to the .yalc location, rather than the node_modules/... location.

In turn this breaks my current case since the generated library parts are going into the wrong directory now:

image

In the above .yalc should be node_modules.

@wclr
Copy link
Owner

wclr commented Feb 26, 2021

Sorry, I'm not following. Try to explain the steps you make to get the issue, or maybe there could be a repro example.

@jasonkuhrt
Copy link
Author

  1. Create a package A with a bin specified in package.json
  2. yalc add A in some other project B
  3. yalc push A
  4. A gets put into B like normal, but its bin script is symlinked into B/.yalc/A/... it should be pointing toward B/node_modules/A.

@wclr
Copy link
Owner

wclr commented Feb 26, 2021

Right. There seems not need bin sysmlinks are created while add operation. Will fix it soon.

@jasonkuhrt
Copy link
Author

Also @wclr I am seeing issues with regard to needing to run chmod +x over the bin file. Maybe related to #21. I assume package managers do this chmod +x automatically and its just that yalc is not right now?

@wclr
Copy link
Owner

wclr commented Feb 26, 2021

I am seeing issues with regard to needing to run chmod +x over the bin file.

What bin file? Where it is located?

Actually, I'm a little bit confused with this thing with .bin scripts, which was added but a contributor's PR. I generally never use linking and never run into those issue, cause I generally use --pure adding. I believe linking of bin script from .yalc folder need only if yalc link or yalc add --link (yarn's link: protocol), if just yalc add is used then PM should take care of installing bin scripts.

@jasonkuhrt
Copy link
Author

jasonkuhrt commented Feb 26, 2021

I used yalc push --force and yalc add.

What bin file? Where it is located?

In the package where run yalc push --force. The script is listed in package.json bin field. Location should not matter. Whatever the value of bin in package.json is.

@wclr
Copy link
Owner

wclr commented Feb 26, 2021

Location should not matter. Whatever the value of bin in package.json is.

I mean is it related to this code?

Do you have the stack trace?

@jasonkuhrt
Copy link
Author

jasonkuhrt commented Mar 3, 2021

I mean is it related to this code?

Yep seems it would be!

@devinrhode2
Copy link

I've found in this situation where you are exclusively working on some ./node_modules/.bin/{foo,bar}, npm link (6/7/?) works better than yalc.

One reason I say this is that I found yalc was not installing dependencies from the external library/npm package. I think with npm link it's irrelevant. Your libraries deps are not mixed into your primary projects node_modules.

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

No branches or pull requests

3 participants