:wave:
I just installed a nightly build of yarn to get all the latest goodies. Following the instructions at https://github.com/yarnpkg/yarn/issues/1474 and https://github.com/yarnpkg/website/pull/245:
wget https://yarnpkg.com/install.sh
chmod +x install.sh
install.sh --nightly
The install script told me to remove ~/.yarn
so I did, then re-ran it. Now I get this error when I run yarn
:
❯ yarn -V
0.17.0-20161107.1501
/Users/zeke/.yarn/bin/yarn.js:47
throw err;
^
Error: ENOENT: no such file or directory, open '/Users/zeke/Library/Caches/Yarn/.roadrunner.json'
at Error (native)
at Object.fs.openSync (fs.js:640:18)
at Object.fs.writeFileSync (fs.js:1333:33)
at /Users/zeke/.yarn/node_modules/roadrunner/index.js:25:6
at /Users/zeke/.yarn/node_modules/roadrunner/index.js:12:12
at emitOne (events.js:101:20)
at process.emit (events.js:188:7)
at processEmit [as emit] (/Users/zeke/.yarn/node_modules/signal-exit/index.js:140:35)
at process.exit (internal/process.js:146:15)
at Command.<anonymous> (/Users/zeke/.yarn/node_modules/commander/index.js:825:13)
Once I've actually used yarn to add
a dep somewhere, this error goes away, pesumably because this directory is created as a side-effect of the installation process?
I suspect this is due to #1638. @kittens
workaround: mkdir ~/Library/Caches/Yarn
I have the same on Travis CI with a stable version (npm install -g yarn
).
It just happened to me using Ubuntu inside Virtual Box (host is Windows 10).
As suggested above, I installed any package using yarn add
and the error goes away.
Same here on Arch Linux and [email protected]
Same here when installed on CI via curl/bash:
curl -o- -L https://yarnpkg.com/install.sh | bash
results in:
$ curl -o- -L https://yarnpkg.com/install.sh | bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 94 100 94 0 0 637 0 --:--:-- --:--:-- --:--:-- 639
100 3531 100 3531 0 0 22083 0 --:--:-- --:--:-- --:--:-- 22083
Installing Yarn!
> Downloading tarball...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 92 100 92 0 0 665 0 --:--:-- --:--:-- --:--:-- 666
0 0 0 595 0 0 3105 0 --:--:-- --:--:-- --:--:-- 3105
100 3531k 100 3531k 0 0 13.3M 0 --:--:-- --:--:-- --:--:-- 56.5M
> Extracting to ~/.yarn...
> Adding to $PATH...
> We've added the following to your /home/ubuntu/.bashrc
> If this isn't the profile of your current shell then please add the following to your correct profile:
export PATH="$HOME/.yarn/bin:$PATH"
/home/ubuntu/.yarn/bin/yarn.js:47
throw err;
^
Error: ENOENT: no such file or directory, open '/home/ubuntu/.cache/yarn/.roadrunner.json'
at Error (native)
at Object.fs.openSync (fs.js:640:18)
at Object.fs.writeFileSync (fs.js:1333:33)
at /home/ubuntu/.yarn/node_modules/roadrunner/index.js:25:6
at /home/ubuntu/.yarn/node_modules/roadrunner/index.js:12:12
at emitOne (events.js:101:20)
at process.emit (events.js:188:7)
at processEmit [as emit] (/home/ubuntu/.yarn/node_modules/signal-exit/index.js:140:35)
at process.exit (internal/process.js:146:15)
at Command.<anonymous> (/home/ubuntu/.yarn/node_modules/commander/index.js:825:13)
> Yarn was installed, but doesn't seem to be working :(.
Hitting this issue on heroku too. (ref https://github.com/heroku/heroku-buildpack-nodejs/issues/337#issuecomment-255140610)
A temporary solution is to rollback to 0.16.1
Having the same problem on CircleCI.
If you're on Ubuntu or Debian, you can temporarily roll back by doing:
wget https://yarnpkg.com/downloads/0.16.1/yarn_0.16.1_all.deb
sudo dpkg -i yarn_0.16.1_all.deb
I'll work on keeping multiple versions of Yarn in the Debian repo to make it easier in the future.
Similarly, if you're using a tarball, you can download the tarball from https://yarnpkg.com/downloads/0.16.1/yarn-v0.16.1.tar.gz to get 0.16.1.
On Debian, when upgrading a globally installed yarn 0.16.1 through npm, the path is: '/usr/local/share/.cache/yarn/.roadrunner.json'
. There's no cache
or .cache
in /usr/local/share
; however, the directory '/usr/local/share/.yarn'
exists and is empty.
Ended up just doing npm install -g [email protected]
. The rest of my app's versions are locked down, I suppose it makes sense to lock yarn as well.
I'm going to work on adding a --version flag to the installer, and also having multiple versions in the Debian repo. That'll allow you to more easily lock down the version of Yarn.
I've updated the Debian repo to contain all releases, not just the latest one. I think we'll start suggesting locking the Yarn version for CI environments (such as CircleCI, TravisCI, etc). You can update the apt-get
line in your build script to something like this:
sudo apt-get install -yy yarn=0.16.1-1
Which will always install 0.16.1, even if a newer version comes out. This should prevent your builds from breaking due to new Yarn releases! 😄
You can run apt-cache policy yarn
to see a list of all available versions:
yarn:
Installed: 0.16.1-1
Candidate: 0.16.1-1
Version table:
*** 0.16.1-1 500
500 http://dl.yarnpkg.com/debian stable/main amd64 Packages
100 /var/lib/dpkg/status
0.16.0-1 500
500 http://dl.yarnpkg.com/debian stable/main amd64 Packages
0.15.0-1 500
500 http://dl.yarnpkg.com/debian stable/main amd64 Packages
Yarn creates MODULE_CACHE_DIRECTORY/.roadrunner.json
, where MODULE_CACHE_DIRECTORY
can be ~/.cache
or ~/Library/Caches/Yarn
depending on the system.
I think either yarn should use temporary directory for roadrunner or read config file to get cache directory.
I'm having the same problem while setting --cache-folder
, e.g.
$ yarn install --cache-folder ./tmp/yarn-cache
Mac OSX fix: mkdir -p ~/Library/Caches/Yarn
Hi @msmfsd How to fix it, if the yarn was installed through nvm npm -g -i yarn
?
@wellyshen nvm clear-cache
Fixed via #1902.
Hi @wyze The problem still exist, I install the yarn through nvm (npm -i -g yarn) and I also clear cache as @MoeSattler mentioned before running yarn --version
, and the error occurs:
Now, I install back to the v0.16.1, and it works... I wish the v0.17 version could also works for me
There hasn't been a release with this fix included yet. See #1859 to follow along our progress 0.17.x.
@wyze OK, thanks. I will waiting for the new version
@wellyshen 0.17.4 includes exactly the fix for https://github.com/yarnpkg/yarn/issues/1724
@sejoker COOL I have verified, it fixed, thanks
Most helpful comment
workaround:
mkdir ~/Library/Caches/Yarn