Yarn: nvm is not compatible with the "PREFIX" environment variable

Created on 9 Jan 2018  路  5Comments  路  Source: yarnpkg/yarn

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

triaged

Most helpful comment

just force closing the terminal and reopening worked for me.

All 5 comments

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

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

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

just force closing the terminal and reopening worked for me.

Was this page helpful?
0 / 5 - 0 ratings