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

yarn config rewrites #7158

Open
izenk opened this issue Mar 29, 2019 · 1 comment
Open

yarn config rewrites #7158

izenk opened this issue Mar 29, 2019 · 1 comment

Comments

@izenk
Copy link

izenk commented Mar 29, 2019

bug
Ubuntu 16.04 x64
yarn 1.15.2

What is the current behavior?
Yarn config command rewrites relative paths in some cases to absolute paths

To reproduce in my case

cd to project directory
yarn config set yarn-offline-mirror vendor/npm_cache
look at /home/<your_user>/.yarnrc and find that

# yarn lockfile v1
yarn-offline-mirror vendor/npm_cache

then run
yarn config set yarn-offline-mirror-pruning true
and check /home/<your_user>/.yarnrc again, you will find

# yarn lockfile v1
yarn-offline-mirror "/home/app/vendor/npm_cache"
yarn-offline-mirror-pruning true

Relative path of offline-mirror changed to absolute path.

If you run again

yarn config set yarn-offline-mirror vendor/npm_cache

It will be change to relative again in .yarnrc

If you run first
yarn config set yarn-offline-mirror-pruning true
and then

yarn config set yarn-offline-mirror vendor/npm_cache

Everything is as expected

# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1

yarn-offline-mirror "vendor/npm_cache"
yarn-offline-mirror-pruning true

What is the expected behavior?
The offline-mirror path should stay the same as was set previously.

@izenk
Copy link
Author

izenk commented Apr 15, 2019

One more example of incorrect behavior.

If module-path option is added to yarnrc, then 'yarn bin' works incorrectly

app@8613468dd8e9:~/core$ cat .yarnrc && yarn bin
--modules-folder vendor/node_modules
warning package.json: No license field
/home/app/core/home/app/core/vendor/node_modules/.bin

As seen, for some reason <app_path> (which is '/home/app/core' in my case) is duplicated, what leads to incorrect behavior.

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

1 participant