Do you want to request a _feature_ or report a _bug_?
Bug.
What is the current behavior?
An unlinked (but added) package is missing from node_modules and yarn will not install.
If the current behavior is a bug, please provide the steps to reproduce.
git clone [email protected]:tj/co.git
cd co && yarn link
As a side note, yarn will not install the package's dependencies. The default npm client would do that. I'm not sure whether that's expected or not given that the linking process is slightly different already.
yarn link co
add
yarn add co
The linked package is still used at this point (and that's consistent with the default client).
yarn unlink co
This will remove the link from node_modules as expected.
```
yarn
yarn install v0.15.1
warning No license field
success Already up-to-date.
Done in 0.13s.
ls node_modules
```
At this point, the package is not present in node_modules but yarn seems to be okay with that and won't install it. Doing yarn add co again _will_ install it.
What is the expected behavior?
The package should be installed after unlinking it and running yarn.
Please mention your node.js, yarn and operating system version.
Node.js 6.7.0
Yarn 0.15.1
Ubuntu 12.04
This still seems to be an issue with yarn v0.18.1.
@andybluntish only workaround I've found is to either delete the node_modules folder entirely, or to yarn add something then revert changes.
You can also workaround by deleting yarn.lock, instead of nuking node_modules
The following command was a sufficient workaround for me:
yarn install --check-files
https://yarnpkg.com/en/docs/cli/install#toc-yarn-install-check-files
Can repro.
The problem is in linkedModules field in node_modules/.yarn-integrity.
Yarn would ignore a missing folder if it is a modules globally registered as linked.
It should at least check if symlink exists
I feel like @arcanis addressed this in PR not too long ago. @arcanis can you confirm?
Any updates here?
I can still reproduce this with 1.8.0
PS my-scripts> yarn unlink @gongt/stillalive
yarn unlink v1.12.1
success Removed linked package "@gongt/stillalive".
info You will need to run `yarn` to re-install the package that was linked.
Done in 0.10s.
PS my-scripts> yarn
yarn install v1.12.1
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.20s.
PS my-scripts> dir .\node_modules\@gongt\
PS my-scripts>
Still problem v1.12.1
Hi @arcanis . Based on the comments in https://github.com/yarnpkg/yarn/issues/1957 and https://github.com/yarnpkg/yarn/pull/6931, I think this issue should be reopened. The messaging is better now, but ultimately a yarn install should restore any unliked packages.
Most helpful comment
The following command was a sufficient workaround for me:
yarn install --check-fileshttps://yarnpkg.com/en/docs/cli/install#toc-yarn-install-check-files