yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.44k stars 2.73k forks source link

nvm is not compatible with the "PREFIX" environment variable #5202

Open peterharding opened 6 years ago

peterharding commented 6 years ago

Do you want to request a feature or report a bug? Bug

What is the current behavior? When executing a shell script from package.json scripts that uses nvm, this error is shown:

nvm is not compatible with the "PREFIX" environment variable: currently set to "/usr/local"
Run `unset PREFIX` to unset it.

If the current behavior is a bug, please provide the steps to reproduce. Minimal repository: https://github.com/peterharding/yarn_prefix_bug

screen shot 2018-01-09 at 11 35 37 am

What is the expected behavior? yarn run <command> behaves the same as npm run <command> and does not produce an error.

Please mention your node.js, yarn and operating system version. Versions used: nvm 0.33.4 node v8.9.1 yarn 1.3.2 OSX 10.11.6

arcanis commented 6 years ago

We don't change the value of the PREFIX afaik. Have you checked if you have it in your environment?

peterharding commented 6 years ago

screen shot 2018-01-11 at 9 33 00 am

https://github.com/peterharding/yarn_prefix_bug updated with log files that have full env outputs

peterharding commented 6 years ago

https://github.com/yarnpkg/yarn/blob/master/src/registries/npm-registry.js#L46 possible culprit

yyjazsf commented 6 years ago

when I use yarn 1.3.x ,vscode integrated terminal usually report it. but my iTerm2 is ok. now,I use yarn 1.5.1. all terminal are work well,you can try to update yarn

rp01 commented 5 years ago

just force closing the terminal and reopening worked for me.